![]() |
Controlling the position of attachments and Body Text in Outlook
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 |
Controlling the position of attachments and Body Text in Outlook
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. -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Richard Buttrey" wrote in message ... 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 |
All times are GMT +1. The time now is 11:24 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com