[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[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 !!
 
Related Solutions
Keywords: Cognos Script Editor: Writing scripts t…
 
Loading Advertisement...
 
[+][-]05/05/07 06:36 PM, ID: 19037910Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/05/07 06:38 PM, ID: 19037911Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/07/07 06:40 AM, ID: 19042531Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/07/07 07:01 AM, ID: 19042640Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/09/07 05:31 AM, ID: 19056342Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/09/07 05:52 AM, ID: 19056471Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/09/07 05:59 AM, ID: 19056519Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/09/07 06:32 AM, ID: 19056732Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/09/07 08:17 AM, ID: 19057665Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/09/07 08:28 AM, ID: 19057778Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/15/07 04:34 AM, ID: 19091837Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/19/07 01:25 PM, ID: 19319537Administrative Comment

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 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]06/26/07 03:00 AM, ID: 19362148Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/26/07 04:22 AM, ID: 19362561Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/26/07 06:21 AM, ID: 19363346Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/06/07 07:57 AM, ID: 19432244Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/06/07 08:08 AM, ID: 19432334Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/06/07 09:04 AM, ID: 19432804Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/06/07 10:07 AM, ID: 19433248Author Comment

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 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/06/07 10:46 AM, ID: 19433559Expert Comment

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 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/30/07 09:56 AM, ID: 20178970Administrative Comment

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 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93