View Single Post
  #2  
Old May 16th 08, 08:53 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Send Word doc attachment


Depending on your Outlook version, you can set the EMailItem's BodyFormat
property to 2 (for HTM).

For a line break add vbCRLF.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool:
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Fri, 16 May 2008 06:52:01 -0700 schrieb Chris:

I'm a super novice with VBA, so please bear with my lack of knowledge.

:-)
Using Word and Outlook 2003, and thanks to code offered in previous
discussions here, I have a Send Form command button on a Word form that

opens
an Outlook message, pre-addressed, with a body text offering "Additional
comments:" The only problem is the Word document attachment icon (the
message opens in Rich Text format) is directly above the body text. Some
message recipients want to click directly next to the colon after

"comments"
and begin to type. Naturally, the attachment icon is activated, and the
typed additional text pushes the icon across the message.

Is there any way to add a blank line between the icon and the beginning of
the body text? Or, is there a way to make the message format HTML so that
the attachment icon shows under the Subject line and not in the message

body?
Would greatly appreciate any assistance.

The code I'm using:
Private Sub CommandButton1_Click()

Dim OL As Object
Dim EmailItem As Object
Dim Doc As Document

Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Doc = ActiveDocument
With EmailItem
.Subject = "Subject Title"
.Body = "Additional comments:"
.To = "
.Importance = olImportanceNormal 'Or olImprotanceHigh Or
olImprotanceLow
.Attachments.Add Doc.FullName
.Display
End With

Application.ScreenUpdating = True

Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing

End Sub

Ads