PDA

View Full Version : Multiple Images in Outlook



MWE
01-08-2011, 04:48 PM
I am running Outlook 2003. I use Word 2003 as my editor in Outlook. I have created a VBA procedure that constructs something similar to a signature. In particular, it is a 1 row by 2 col table with a logo in the left cell and a bit of text with a hyperlink in the right cell.

If I construct this manually, I end up with "what I want" and the resulting mail item has a single "attachment", i.e., the embedded logo file.

If I construct this using VBA, I again end up with "what I want" and it looks identical to the manually constructed version, but the resulting mail item has two attachments: the embedded logo file and a "true" attachment of that file. The code fragment is: Set wdCell = wdTable.cell(1, 1)
wdCell.Width = InchesToPoints(0.7)
wdCell.Height = InchesToPoints(0.5)
ActiveDocument.Shapes.AddPicture FileName:=PixName, _
LinkToFile:=False, _
SaveWithDocument:=True, _
Left:=0, _
Top:=0, _
Width:=InchesToPoints(0.65), _
Height:=InchesToPoints(0.5), _
Anchor:=wdCell.Range
Why do I get a duplicate of the logo file as an extra attachment when I do this via VBA? How can I eliminate that extra attachment during the creation process?