Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CognosScript and Lotus Notes 2

Status
Not open for further replies.

jezmondo

IS-IT--Management
Aug 24, 2001
23
GB
I am trying to set up a macro that runs a simple report, publishes it as .PDF and then opens Notes and mails a user to let them know the report has run. I'm having difficulty with the final part of this i.e. getting the macro to open Notes and mail the user...

If poss I would like to automatically attach the .PDF file and mail it...

Any help gratefully accepted

Jez
 
Enjoy:

Set obj_NotesSession = CreateObject("Notes.obj_NotesSession")
str_MailServer = obj_NotesSession.GetEnvironmentString("str_MailServer",True)
str_MailFile = obj_NotesSession.GetEnvironmentString("str_MailFile",True)

Set obj_NotesDB = obj_NotesSession.GetDatabase(str_MailServer,str_MailFile)
Set obj_Doc = obj_NotesDB.CreateDocument()
str_NotesBody = <body>
str_NotesSubject = <subject>

obj_Doc.subject = str_NotesSubject
obj_Doc.body = str_NotesBody
Set obj_RichText = obj_Doc.CreateRichTextItem(&quot;Body&quot;)
Set obj_Attach = obj_RichText.EmbedObject(1454, &quot;&quot;,<file to attach>)

obj_Doc.SendTo = <recipient>
Call obj_Doc.Send(False)
 
Thanks for this n30er... however I keep getting the following message when running the macro:

FILE1!Main(33) - R429 &quot;Object creation failed - bad object class&quot;

Any ideas???

Thanks again
 
It's OK now thanks

I had to amend your example to read as follows...

Set objNotesSession = CreateObject(&quot;Notes.NotesSession&quot;)
strMailServer = <name of mail server>
strMailFile = <name of mail file>

Set objNotesDB = objNotesSession.GetDatabase(strMailServer,strMailFile)
Set objDoc = objNotesDB.CreateDocument()
strNotesBody = <text>
strNotesSubject = <text>

objDoc.subject = strNotesSubject
objDoc.body = strNotesBody
Set objRichText = objDoc.CreateRichTextItem(&quot;NewBody&quot;)
Set objAttach = objRichText.EmbedObject(1454, &quot;&quot;,&quot;<file>&quot;)

objDoc.SendTo = <email>
Call objDoc.Send(False)

Thanks for help - it's good to be pointed in the right direction!!
 
Jezmondo Could you see if this code is right? I've written personal information in this code. Could you check and fill up other information that is marked with ?????
Please could you send the right code to brandis@uol.com.br
Tks

Set objNotesSession = CreateObject(&quot;Notes.NotesSession&quot;)
strMailServer = <????>
strMailFile = <????>

Set objNotesDB = objNotesSession.GetDatabase(strMailServer,strMailFile)
Set objDoc = objNotesDB.CreateDocument()
strNotesBody = <You’ve got mail>
strNotesSubject = <Mail for you>

objDoc.subject = strNotesSubject
objDoc.body = strNotesBody
Set objRichText = objDoc.CreateRichTextItem(&quot;NewBody&quot;)
Set objAttach = objRichText.EmbedObject(1454, &quot;&quot;,&quot;c:\lixo\teste.txt&quot;)

objDoc.SendTo = <brandis@uol.com.br>
Call objDoc.Send(False)
 
Hi ,

How to go about for multiple users? I tried giving all the user ids separated by comma or semicolon or colon. But doesnt work.
Any idea what should be done?

Thanks in advance
 
You could create groups within Lotus to email to multiple people.
 
Hi,

Thanks for suggesting about the group creation in notes.

But is there any way that multiple ids can be included in the cognos script?

thanks
 
You just keep sticking in more

objDoc.SendTo = <email>
Call objDoc.Send(False)

for each user wouldn't you?

Does anyone know how to put in a Notes password in the macro please?
 
HI

navshiv, I have asked the same question about the notes password in the past and also on the Lotus Notes forum but nobody seem to know how to do this. Dave, do you have any suggestions by any chance..? :->
 
Recce,

Sorry, I've no experience with emailing through Notes. In fact even using Outlook is getting more difficult as MS tries to tighten security.

Dave Griffin
The Decision Support Group
Reporting Consulting with Cognos BI Tools
&quot;Magic with Data&quot;
[pc2]
Want good answers? Read FAQ20-2863 first!
 
Hi,

thank you for the very good information.
Is it also possible to import pdf's directly to a Lotus Notes Database instead of emailing them ?

Regards Hede
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top