View Single Post
  #2  
Old June 29th 09, 04:31 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default Add Multiple Attachments Sources using VBA in Word

You need a separate .Attachments.Add statement for each attachment, not one
long statement with multiple calls to the .Add method.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"JBark" wrote in message
...
Hi,

How can this code be written to add multiple attachments using vba and
Word
as my email editor. The first attachment is the active document itself,
the
other 4 attachments have their full path names stored in a field in the
document. This is what I have but I'm getting a syntax error and I'm not
sure
why. Any suggestions are greatly appreciated.


.Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
.Add Source:=ActiveDocument.TextBox("TextBoxFile1").Res ult,
Type:=olByValue, _
.Add Source:=ActiveDocument.TextBox("TextBoxFile2").Res ult,
Type:=olByValue, _
.Add Source:=ActiveDocument.TextBox("TextBoxFile3").Res ult,
Type:=olByValue, _
.Add Source:=ActiveDocument.TextBox("TextBoxFile4").Res ult,
Type:=olByValue
.Send



Ads