Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default I have posted this message before but did not get any response can anyone help me?

Dear all,

Basically I have been working on sending a lotus notes mail from excel
which by and large I have achieved with little problem. Basically I am
using a userform to populate all the relevant mail field. I then use a
send button to establish an instance of notes then send the actual
information to the specified recipients.

The code works fine however when I try to include more than one
recipient in any of the SendTo, CopyTo etc fields only the first
person in each instance receives the mail. When I examine my sent
items in Lotus notes I can even see the other individuals names
appearing in the relevant fields however for some inexplicable reason
thay just do not appear to receive the mails. Does Excel97 in
conjunction with Lotus Notes only have the capacity to send a mail to
one person for each field in each instance. Please any assistance that
you could provide in relation to this issue would be greatly
appreciated. I just can not figure out why it is not working

Below is the code I am using:

Private Sub UserForm_Activate()

Application.ScreenUpdating = False

Me.txtSendTo.Value = "ExternalEmailAddress"
Me.txtCC.Value = "FirstCCMailrecipient,SecondCCMailRecipient"
Me.txtBCC.Value = ""

Me.txtSubject = "Subject"
Me.txtBody = "Body of Mail entered here"

Application.ScreenUpdating = True


End Sub


Private Sub cmdSend_Click()

Dim objNotesSession As Object
Dim objNotesDatabase As Object
Dim objNotesDocument As Object
' Dim objNotesField As Object
Dim objAttachment As Object
Dim objRichText As Object
Dim FullPath As String
Dim FileName As String
Dim Msg As String
Dim MoveIncrement As Integer
Dim Counter As Integer
Dim EmailCCTo

Const EMBED_ATTACHMENT = 1454 '1454 indicate a file attachment

'Establishes a Lotus Notes Session and Open Notes Database

Set objNotesSession = CreateObject("Notes.Notessession")
Set objNotesDatabase = objNotesSession.GETDATABASE("", "")

On Error GoTo ErrorHandler:

'Open a Mail Session within Lotus Notes

Call objNotesDatabase.OPENMAIL

If objNotesDatabase.isopen = False Then
Msg = "USER INFORMATION :" & vbCrLf & vbCrLf
Msg = Msg & "Cannot connect to Lotus Notes."
MsgBox Msg, vbCritical, Application.Caption
Unload Me
Exit Sub
End If

If objNotesSession.UserName = vbNullString Then
Msg = "USER INFORMATION :" & vbCrLf & vbCrLf
Msg = Msg & "Not logged in to Lotus Notes, please login
and retry."
MsgBox Msg, vbCritical, Application.Caption
Unload Me
Exit Sub
End If

Set objNotesDocument = objNotesDatabase.CreateDocument
Call objNotesDocument.ReplaceItemValue("Form", "Memo")

FileName = ActiveWorkbook.Name
FullPath = ActiveWorkbook.Path & "\" & FileName

' Assemble lotus notes email message

Set objRichText = objNotesDocument.CREATERICHTEXTITEM("Body")
Set objAttachment = objRichText.EmbedObject(EMBED_ATTACHMENT, "",
FullPath, FileName)

' EmailCCTo = Me.txtCC.Value

' Set objNotesField = objNotesDocument.APPENDITEMVALUE("CopyTo",
EmailCCTo)

With objNotesDocument
.Subject = Me.txtSubject.Text
.Body = Me.txtBody & objNotesSession.CommonUserName
.SendTo = Me.txtSendTo.Text
.CopyTo = Me.txtCC.Text
.BlindCopyTo = Me.txtBCC.Text
.SaveMessageOnSend = True ' Save in Sent folder
.Send (False)
End With

'Section of Code below used in animation of Mail Send

MoveIncrement = 1

For Counter = 1 To 90

Me.imgMailSend.Left = Me.imgMailSend.Left + MoveIncrement
DoEvents

' Specify time to pause Excel Execution in Sleep API function
'in milliseconds where a value of 1000 equates to 1 second

Sleep 10 '0.01 of a second

Next

Application.ScreenUpdating = True

Me.Hide

ExitHe

'Clear out objects i.e. set them to nothing

Set objNotesSession = Nothing
Set objNotesDatabase = Nothing
Set objNotesDocument = Nothing
' Set objNotesField = Nothing
Set objAttachment = Nothing
Set objRichText = Nothing

Msg = "USER INFORMATION : " & vbCrLf & vbCrLf
Msg = Msg & "Your Lotus Notes message was successfully sent..."

MsgBox Msg, vbInformation, "STATUS ON EMAIL"
' ThisWorkbook.Close

Unload Me
Exit Sub

ErrorHandler:
Err.Raise Err.Number, Err.Source, Err.Description
Resume ExitHere

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
How do I transform a word response to a numeric response? kanegaro Excel Discussion (Misc queries) 0 January 11th 08 05:08 PM
How do I set up a daily call out response response register? Pule Excel Worksheet Functions 1 October 7th 07 01:34 PM
Prevoiusly posted message: Unable to remove objects pasted into Excel from HTML grid X-Ice Excel Worksheet Functions 1 January 16th 07 10:57 AM
Automatic response to message box? Benjamin[_3_] Excel Programming 1 September 15th 03 03:52 PM
Re-posted need more detail Gav !! Excel Programming 2 August 29th 03 08:30 AM


All times are GMT +1. The time now is 02:18 PM.

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"