Yes - I kept digging and I was declaring the fields as formfields but they're
really textboxes. It works now like this:
> .Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue
> Attachments.Add Source:=ActiveDocument.TextBoxFile1.Value,
Type:=olByValue
> Attachments.Add Source:=ActiveDocument.TextBoxFile2.Value,
Type:=olByValue
> Attachments.Add Source:=ActiveDocument.TextBoxFile3.Value,
Type:=olByValue
> Attachments.Add Source:=ActiveDocument.TextBoxFile4.Value,
Type:=olByValue
> Send
Thanks a bunch for your help!
"Sue Mosher [MVP]" wrote:
> If you have already made the change I suggested -- removing the extraneous
> underscore characters so that you have each Attachments.Add call in a
> separate statement -- I would suggest looking at the actual value of what
> you're getting from the ActiveDocument.TextBox("TextBoxFile1").Result
> expressions.
> > Sue Mosher
> > >
> "JBark" <JBark> wrote in message
> news:F602CE82-F4CD-4545-8F73-AC8A8BCC8A77@microsoft.com...
> > Thanks Sue. The code runs fine without any errors and attaches the
> > original
> > doc but not the additional docs. Should I ask someone over in the Word
> > Forum
> > about this? Or do you have a suggestion as to why the additional files
> > will
> > not attach?
> "Sue Mosher [MVP]" <suemvp@turtleflock.com> wrote in message
> news:Obl0OZN%23JHA.2824@TK2MSFTNGP03.phx.gbl...
> > This is still all one statement, because of the underscore continuation
> > characters at the end of the first four lines.
> > "JBark" <JBark> wrote in message
> > news:E7B89599-FD4F-4E32-9052-569B27FBB3CB@microsoft.com...
> >> Yes - I had tried that also like this, but I'm still getting syntax
> >> error.
> >
> >> .Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
> >> .Attachments.Add
> >> Source:=ActiveDocument.TextBox("TextBoxFile1").Result,
> >> Type:=olByValue, _
> >> .Attachments.Add
> >> Source:=ActiveDocument.TextBox("TextBoxFile2").Result,
> >> Type:=olByValue, _
> >> .Attachments.Add
> >> Source:=ActiveDocument.TextBox("TextBoxFile3").Result,
> >> Type:=olByValue, _
> >> .Attachments.Add
> >> Source:=ActiveDocument.TextBox("TextBoxFile4").Result,
> >> Type:=olByValue
> >> .Send
> >
> >> "Sue Mosher [MVP]" wrote:
> >
> >>> You need a separate .Attachments.Add statement for each attachment, not
> >>> one
> >>> long statement with multiple calls to the .Add method.
> >>
> >>> "JBark" <JBark> wrote in message
> >>> news:B6DFBA55-0410-444F-8A4B-1FE91DAD0B3C@microsoft.com...
> >>> > 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").Result,
> >>> > Type:=olByValue, _
> >>> > .Add Source:=ActiveDocument.TextBox("TextBoxFile2").Result,
> >>> > Type:=olByValue, _
> >>> > .Add Source:=ActiveDocument.TextBox("TextBoxFile3").Result,
> >>> > Type:=olByValue, _
> >>> > .Add Source:=ActiveDocument.TextBox("TextBoxFile4").Result,
> >>> > Type:=olByValue
> >>> > .Send
>