msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Adding af signature file at the end of the body text

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> Outlook Program VBA
Author Message
kurt



Joined: 05 Feb 2008
Posts: 2

PostPosted: Tue Feb 05, 2008 10:26 am    Post subject: Adding af signature file at the end of the body text Reply with quote

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 = "yyy@xxx.com"
.CC = ""
.BCC = ""
.Subject = "Subject text"

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

Anyone have a solution

regards

kurt

Archived from group: microsoft>public>outlook>program_vba
Back to top
View user's profile Send private message
Sue Mosher [MVP-Outlook]



Joined: 12 Aug 2007
Posts: 656

PostPosted: Tue Feb 05, 2008 3:02 pm    Post subject: Re: Adding af signature file at the end of the body text Reply with quote

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.

--
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" wrote in message @d70g2000hsb.googlegroups.com...
> 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 = "yyy@xxx.com"
> .CC = ""
> .BCC = ""
> .Subject = "Subject text"
>
> .body = v & Chr(13) & shell(" path\mydoc.htm")
> end with
>
> Anyone have a solution
>
> regards
>
> kurt
Back to top
View user's profile Send private message
kurt



Joined: 05 Feb 2008
Posts: 2

PostPosted: Tue Feb 05, 2008 12:50 pm    Post subject: Re: Adding af signature file at the end of the body text Reply with quote

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
Back to top
View user's profile Send private message
Sue Mosher [MVP-Outlook]



Joined: 12 Aug 2007
Posts: 656

PostPosted: Tue Feb 05, 2008 5:03 pm    Post subject: Re: Adding af signature file at the end of the body text Reply with quote

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" wrote in message @j20g2000hsi.googlegroups.com...
> 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
>

"Sue Mosher [MVP-Outlook]" wrote in message @TK2MSFTNGP04.phx.gbl...
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.


"kurt" wrote in message @d70g2000hsb.googlegroups.com...
> 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 = "yyy@xxx.com"
> .CC = ""
> .BCC = ""
> .Subject = "Subject text"
>
> .body = v & Chr(13) & shell(" path\mydoc.htm")
> end with
>
> Anyone have a solution
>
> regards
>
> kurt

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
VBA code to put standard string into body of exisiting task I want to make a script that puts standard textstring into the body of an open task. I have found a lot on the internet about the subject, but they all create a new task. I only want to automate a standard string (like date and name) into the bodyof an op

Problem Adding Recipients I am creating an Outlook mail item from within Access and am adding 3 recipients. The code below *should* insert in the To field, in the CC field, and in the CC field. But what happens in reality--w

adding a distlist item to the links collection Hola, I just try to figure out how to add DistListItems to the items links collection. The following code fragement *** Dim As Dim EID As String, StID As String If Then Set = funcG

Consolidate Mail text Can someone please help me write a macro to consolidate text from several mails and put it in a single mail ?

Insert standard text into a new message Hello, I am pretty new at this but, how do you insert standard text into a new e-mail message without deleting the default signature? I am using the following code: Sub Macro1() Set OutLk = Set Email =
Post new topic   Reply to topic    msoutlook.org Forum Index -> Outlook Program VBA All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group