Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Lotus Notes email background processing and open new message.

I'm using the code below as an example. This code appears to populate
various fields of a Lotus Notes email and then send it. Using this same
code example, I was wondering if anyone knows of a way to:
Once the fields have been populated (in the background, obviously), I'd like
to then open a physical email document (new message) with the fields
populated as specified in the code. Basically, I don't want the email to
automatically send. Instead, I'd like the email to be opened unsent, with
the specified fields populated.

Can this be done using this code?
Thanks.
Paul

Sub sendEmail()
Dim oSess As Object
Dim Maildb As Object
Dim MailDoc As Object
Dim oItem As Object
Dim flag As Boolean
Dim bodyMsg As String
Dim WasOpen As Integer

emailErr = False

Set oSess = CreateObject("Notes.NotesSession")
Set Maildb = oSess.GETDATABASE("", "")

If Maildb.IsOpen = True Then
WasOpen = 1 'Already open for mail
Else
WasOpen = 0
Call Maildb.openmail 'This will prompt you for password
End If

On Error Goto err_handler

Set MailDoc = Maildb.CREATEDOCUMENT
Set oItem = MailDoc.CREATERICHTEXTITEM("BODY")

' Building Message
bodyMsg = "This email was generated by Cupid V3.0." & vbCrLf & vbCrLf
bodyMsg = bodyMsg & "Warning! The attached file contains confidential
information. Any unauthorized review, use, or distribution is prohibited. "
bodyMsg = bodyMsg & "If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message."
With MailDoc
.Form = "Memo"
.subject = "NIR from " & divContact & " (" & divNumber & ")"
.sendto = emailAddress
.body = bodyMsg
.postdate = Date
.SaveMessageOnSend = True
End With

' Attaching new item file.
Call oItem.EmbedObject(1454, "", emailPath)
MailDoc.visable = True

' Sending Message
MailDoc.send False

exit_SendAttachment:
On Error Resume Next
Set oSess = Nothing
Set Maildb = Nothing
Set MailDoc = Nothing
Set oItem = Nothing

' Done
Exit Sub

err_handler:
emailErr = True
If Err.Number = 7225 Then
MsgBox "File doesn't exist"
Else
MsgBox Err.Number & " " & Err.Description
End If
On Error Goto exit_SendAttachment
End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Email Lotus Notes StephanieH Excel Programming 3 January 13th 09 07:24 AM
lotus notes email pdaws Excel Worksheet Functions 2 October 2nd 08 04:08 PM
Using VBA to create an actual email message in Lotus Notes Ron de Bruin Excel Programming 0 May 16th 07 06:10 PM
Why won't AOL email communicate with lotus notes email? ManInaMaze Excel Discussion (Misc queries) 0 August 3rd 05 02:41 AM
Email using Lotus Notes & FollowHyperlink Glenn Ray[_3_] Excel Programming 2 April 26th 05 08:26 PM


All times are GMT +1. The time now is 02:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"