Can I specify font for body content of email using vba macro.

J

JBark

Hello - when I use vba to create an Outlook mail item, can I specify the font
to be used? Right now it pulls whatever the user has set as the default in
Word under Tools > Options > General > Email Options.

Can it be added to this? Thanks.

With oItem
.To = "(e-mail address removed)"
.Subject = "MySubject"
'Add the document as an attachment, you can use the .displayname property
'to set the description that's used in the message
.Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue
.Body = ActiveDocument.Content
.Send
End With
 
D

Doug Robbins - Word MVP

Use:

ActiveDocument.Range.Copy
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
.To = "(e-mail address removed)"
.Subject = "mysubject"
.BodyFormat = olFormatHTML
.Display
Set objDoc = .GetInspector.WordEditor
Set objSel = objDoc.Windows(1).Selection
objSel.Paste
.Send
End With
Set oItem = Nothing


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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