Adding af signature file at the end of the body text

K

kurt

Hi

I tried to put in the signature after I have made a mailtext in VBA ,
but the text is replaced by the signature

the code is like this

v=" Myletter text"
With OutMail
.to = "(e-mail address removed)"
.CC = ""
.BCC = ""
.Subject = "Subject text"

.body = v & Chr(13) & shell(" path\mydoc.htm")
end with

Anyone have a solution

regards

kurt
 
S

Sue Mosher [MVP-Outlook]

If you want to append and not replace text, you need to include the original text:

.Body = .Body & vbCrLf & "some new text"

You probably have a bit more work to do, though, but I can't quite tell what you're trying to do. I do know that a Shell command is not going to read the content of the HTML file into a string variable. Neither is HTML content going to translate well into the text body of the message.
 
K

kurt

Thank you Sue

I have a signature function on Outlook but I can not control it from
VBA.
This means that your "some new text" should be the text in the
signature file either a .HTM or a .DOC or a .RTF file
or just turn on the insert signature function form VBA

regards

Kurt
 
S

Sue Mosher [MVP-Outlook]

If you're trying to use an existing signature, you probably don't need to read in the text. See http://www.outlookcode.com/codedetail.aspx?id=615 for code sample.

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


kurt said:
Thank you Sue

I have a signature function on Outlook but I can not control it from
VBA.
This means that your "some new text" should be the text in the
signature file either a .HTM or a .DOC or a .RTF file
or just turn on the insert signature function form VBA

If you want to append and not replace text, you need to include the original text:

.Body = .Body & vbCrLf & "some new text"

You probably have a bit more work to do, though, but I can't quite tell what you're trying to do. I do know that a Shell command is not going to read the content of the HTML file into a string variable. Neither is HTML content going to translate well into the text body of the message.
 

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