Controlling the position of attachments and Body Text in Outlook

R

Richard Buttrey

I have some VBA code which loops through a list of Excel files,
attaches them to an Outlokk email and sends them.

Everything works fine except that I'd like a bit more control over
where the file attachments and the Body text are placed.

The default seems to be the files first - horizontally as the first
'line' of the email, followed immediately underneath by the text of
the "Body Text' Parameter. I'd also like to be able to alter the size
of the embedded file 'icon' since the default size truncates the name
of the file and makes it difficult to see at a glance.

I can see that the

..Attachments.Add

has various parameter like Type, Position, Display Name etc., although
Im not altogether clear how to use these.

All help gratefully received.

Richard Buttrey




__
"We are with Europe, but not of it. We are linked but not combined.
We are associated but not absorbed. And should European statesmen address
us and say, 'Shall we speak for thee?', we should reply,
'Nay Sir, for we dwell among our own people'."
Winston Churchill - 1953"

Richard Buttrey, Grappenhall, Cheshire, UK
 
D

Dick Kusleika

Richard

The Position argument is a long integer that relates to the character of the
Body string. So if you want your icon to be in the middle of a sentence,
you could do this

With olMi
.Body = "This is my attachment"
.Attachments.Add "Book1.xls", , 5
End With

and it will look like this

This <<attachment>> is my attachment

where <<attachment>> is the icon.

Note that the fifth character in the Body string is replaced (not inserted),
so you need to throw an extra space in your Body string or lose characters.

I don't know how to change the appearance of the icon. You can use the
DisplayName argument to make a shorter name.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top