View Single Post
  #5  
Old March 31st 08, 10:36 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Replying to an e-mail with boilerplate text and an attachment

That statement won't work as you expect it to, because it puts the signature *outside* the htmlbody and /body/html tags when instead it needs to go inside -- *and* be completely tagged HTML content. In other words, it takes a bit of text parsing with the Instr(), Mid(), and Left() functions.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"JP" wrote in message ...
What do you mean "previous text"? You mean the text of the original
message? In my testing the code replies to the message then inserts
the boilerplate text at the top, exactly as if you had done so
manually. The original text of the message is preserved at the bottom
of the stock reply.

That is what this line does:

olNewMailItem.HTMLBody = Signature & olNewMailItem.HTMLBody

It sets the HTMLBody property of the new message to the text of the
signature (the boilerplate text) then appends the original text of the
reply (as if you had pressed "Reply").

You don't need to add the attachment to the signature. As I mentioned
in the previous message, you can specify an attachment in the call to
the function. This makes it more flexible in that you can have
different boilerplates and attachments for different situations.


HTH,
JP

On Mar 31, 2:25 pm, peeweejd wrote:
On Mar 31, 1:42 pm, JP wrote:

One way:


First set up asignaturewith the boilerplate text. Then paste this
code in a standard module in the Outlook VBE.


Thanks for the help. I tried it, but all of the previous text is
wiped out by the signature.

ps- your stockreplysounds a bit like the "bug letter" urban legend


yeah, I didn't think that I should bore you all with my schmoozing ;-)

Thanks for the help. I may just use the "signature" trick. It's
really too bad that you cannot add an attachment to a signature file.


Ads