Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think you would need to loop reading all files and embedding them one at a
time. -- HTH Bob Phillips "Chad" wrote in message ups.com... Hi Thanks this works perfectly. I can now have as many email addresses as I wish attaching a single file. I tried to alter the code to have an array refer to the corresponding file in Col B so I can attach multiple files but it has been failing. Is there something obviously wrong with the code? Thanks Chad Sub SendLotusNote() ' be sure to reference the Lotus Domino Objects, domobj.tlb Dim objNotesSession As Object Dim objNotesDatabase As Object Dim objNotesDocument As Object Dim objAttachment As Object Dim objRichText As Object Dim FullPath As String Dim FileName As String Dim Msg As String Dim aryAddys() Dim myAry() Const EMBED_ATTACHMENT = 1454 Set objNotesSession = CreateObject("Notes.Notessession") Set objNotesDatabase = objNotesSession.GetDatabase("*", "") Call objNotesDatabase.OpenMail 'default mail database If objNotesDatabase.IsOpen = False Then MsgBox "Cannot connect to Lotus Notes." Exit Sub End If Set objNotesDocument = objNotesDatabase.CreateDocument Call objNotesDocument.ReplaceItemValue("Form", "Memo") ActiveWorkbook.Save 'Following 2 lines holt code. myAry = Range("B1:B100") FullPath = myAry 'does not like this. ' FullPath = Range("A1").Value '(original C wks fine) ' assemble message Set objRichText = objNotesDocument.CreateRichTextItem("Body") Set objAttachment = objRichText.EmbedObject(EMBED_ATTACHMENT, "", FullPath) Msg = "Lotus Note sent from " & objNotesSession.CommonUserName With objNotesDocument .Subject = "" .body = Msg aryAddys = Range("B1:B100") .SendTo = aryAddys .SaveMessageOnSend = True ' save in Sent folder) .Send (False) End With Set objNotesSession = Nothing Set objNotesDatabase = Nothing Set objNotesDocument = Nothing Set objAttachment = Nothing Set objRichText = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
meaning of : IF(Switch; Average(array A, array B); array A) | Excel Worksheet Functions | |||
Having some problems linking an array across excel files | Excel Discussion (Misc queries) | |||
Best way to import fixed-width delimited text files into an array? | Excel Programming | |||
Basic Q: Field/Array info when importing fixed-width text files | Excel Programming | |||
Adding files to an array using Dir | Excel Programming |