Advertisement

05.05.2007 at 03:40AM PDT, ID: 22554463 | Points: 125
[x]
Attachment Details

Cognos Script Editor: Writing scripts to send email with attachment from LNotes automatically

Asked by zeep in Impromptu, Lotus Notes

Hi,

What:
scripts to attach a zipped file in email (Lotus Notes) and send it automatically via launching the cognos scheduler.

The script:
===============
Option Explicit

Sub SendMessage(SendTo As String, CcTo As String, Subject As String, _
         Body As String, FileToSend As String)
         
   Dim LnSession        As Object
   Dim LnDb             As Object
   Dim LnDoc            As Object
   Dim LnRtItem         As Object
   Dim LnAttachment     As Object
     
   Set LnSession = CreateObject("Notes.NotesSession")
   'You replace the .nsf file mentioned on the next line with your on .nsf file
   Set LnDb = LnSession.GetDatabase("", "C:\Lotus\Notes\Data\MYNAME.nsf")
   Set LnDoc = LnDb.CreateDocument()
   LnDoc.Form = "Memo"
   LnDoc.SendTo = SendTo
   LnDoc.CopyTo = CcTo
   LnDoc.Subject = Subject
   LnDoc.Body = Body
   LnDoc.SaveMessageOnSend = True
   Set LnRtItem = LnDoc.CreateRichTextItem("MyBody")
   Set LnAttachment = LnRtItem.EmbedObject(1454, "", FileToSend)

   Call LnDoc.Send(False)

   Set LnAttachment = Nothing
   Set LnRtItem = Nothing
   Set LnDoc = Nothing
   Set LnDb = Nothing
   Set LnSession = Nothing
 
End Sub


Sub Main()

   Dim Receiver            As String
   Dim CopyTo              As String  
   Dim SubjectText         As String
   Dim BodyText            As String
   Dim AttachFile          As String
   Dim DoFileExistCheck    As String
   Dim DoFileDateCheck     As String


   Receiver = "ADDRESSEE@ADDRESS.COM"
   CopyTo = ""
   SubjectText = "ZIPPED FILE TO YOU"
   BodyText = "ATTACHED IS THE ZIPPED FILE FOR YOUR REFERENCE"
   AttachFile = "\\ZIPPED FILES.ZIP"
   
   Call SendMessage(Receiver, CopyTo, SubjectText, BodyText, AttachFile)
   
End Sub

===============


Problem:

The error stops at the line:

Set LnAttachment = LnRtItem.EmbedObject(1454, "", FileToSend)


What has gone wrong ?

Anyone knows how to rectify this/ how to write a script to attach zipped files or any attachment in lotus notes ?

Thanks !!Start Free Trial
[+][-]05.05.2007 at 06:36PM PDT, ID: 19037910

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2007 at 06:38PM PDT, ID: 19037911

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.07.2007 at 06:40AM PDT, ID: 19042531

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.07.2007 at 07:01AM PDT, ID: 19042640

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2007 at 05:31AM PDT, ID: 19056342

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.09.2007 at 05:52AM PDT, ID: 19056471

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.09.2007 at 05:59AM PDT, ID: 19056519

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.09.2007 at 06:32AM PDT, ID: 19056732

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2007 at 08:17AM PDT, ID: 19057665

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.09.2007 at 08:28AM PDT, ID: 19057778

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.15.2007 at 04:34AM PDT, ID: 19091837

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.19.2007 at 01:25PM PDT, ID: 19319537

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]06.26.2007 at 03:00AM PDT, ID: 19362148

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.26.2007 at 04:22AM PDT, ID: 19362561

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.26.2007 at 06:21AM PDT, ID: 19363346

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 07:57AM PDT, ID: 19432244

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 08:08AM PDT, ID: 19432334

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 09:04AM PDT, ID: 19432804

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 10:07AM PDT, ID: 19433248

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 10:46AM PDT, ID: 19433559

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.30.2007 at 09:56AM PDT, ID: 20178970

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32