Help!

How to input text at the beginning of the body of a message.

 
  

Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA RSS
Next:  how to sort what gets deleted  
Author Message
Mr. GetRight
External


Since: Sep 18, 2009
Posts: 1



PostPosted: Fri Sep 18, 2009 7:20 am    Post subject: How to input text at the beginning of the body of a message.
Archived from groups: microsoft>public>outlook>program_vba (more info?)

Need a little help.
I'm using Outlook 2003, trying to make a macro that inputs a set statment in
the body of a message. I got it to do it but the problem is my statement
needs to be in front of the attachment that is already in the message but it
keep going behind it. Also for some reason it is removing the first letter
from my statment. I copy and pasted the main parts of it below, ...

Option Explicit
Public icn As String
Public myOlApp As New Outlook.Application
Public myEmail As Object
Public myAttachment As Object

Sub FormateEmail()


Set myEmail = myOlApp.ActiveInspector.CurrentItem
Set myAttachment = myEmail.Attachments

myEmail.To = "email@someplace.com"
myEmail.Subject = "Subject Line"

myEmail.Body = "output statement 1=" + icn + " Output statement2"

End Sub
Back to top
Michael Bauer [MVP - Outl
External


Since: Aug 04, 2006
Posts: 647



PostPosted: Fri Sep 18, 2009 3:10 pm    Post subject: Re: How to input text at the beginning of the body of a message. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

As your example completely overwrites the body of the message, there's no
reason to see how anything else could be there - except it's an rtf
message, in that case you need to set the position of the attachment(s).

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>

Am Fri, 18 Sep 2009 07:20:02 -0700 schrieb Mr. GetRight:

> Need a little help.
> I'm using Outlook 2003, trying to make a macro that inputs a set statment
in
> the body of a message. I got it to do it but the problem is my statement
> needs to be in front of the attachment that is already in the message but
it
> keep going behind it. Also for some reason it is removing the first letter
> from my statment. I copy and pasted the main parts of it below, ...
>
> Option Explicit
> Public icn As String
> Public myOlApp As New Outlook.Application
> Public myEmail As Object
> Public myAttachment As Object
>
> Sub FormateEmail()
>
>
> Set myEmail = myOlApp.ActiveInspector.CurrentItem
> Set myAttachment = myEmail.Attachments
>
> myEmail.To = "email@someplace.com"
> myEmail.Subject = "Subject Line"
>
> myEmail.Body = "output statement 1=" + icn + " Output statement2"
>
> End Sub
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Programming VBA All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can 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