![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hello - when I use vba to create an Outlook mail item using Word 2003 as the
email editor, can I specify the font to be used in my vba macro code? Right now it pulls whatever the user has set as the default in Word under Tools Options General Email Options Personal Stationary. I tried the code listed below, but it has no effect. Thanks for any suggestions. Set oItem = oOutlookApp.CreateItem(olMailItem) With oItem ..To = " ..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 ..Font.Name = "Verdana" ..Send End With |
Ads |
#2
|
|||
|
|||
![]()
If you use the object browser (F2 in VBA), you'll see that no Outlook
objects have any kind of Font property. You have two choices -- set the value of the HTMLBody property using fully tagged HTML code (same as in a web page) or use oItem.GetInspector.WordEditor to return a Word.Document object and use Word methods to format it. See http://www.outlookcode.com/article.aspx?id=31 for more information. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "JBark" wrote in message ... Hello - when I use vba to create an Outlook mail item using Word 2003 as the email editor, can I specify the font to be used in my vba macro code? Right now it pulls whatever the user has set as the default in Word under Tools Options General Email Options Personal Stationary. I tried the code listed below, but it has no effect. Thanks for any suggestions. Set oItem = oOutlookApp.CreateItem(olMailItem) With oItem .To = " .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 .Font.Name = "Verdana" .Send End With |
#3
|
|||
|
|||
![]()
Thanks Sue - I will check it out and read up on it!
"Sue Mosher [MVP]" wrote: If you use the object browser (F2 in VBA), you'll see that no Outlook objects have any kind of Font property. You have two choices -- set the value of the HTMLBody property using fully tagged HTML code (same as in a web page) or use oItem.GetInspector.WordEditor to return a Word.Document object and use Word methods to format it. See http://www.outlookcode.com/article.aspx?id=31 for more information. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "JBark" wrote in message ... Hello - when I use vba to create an Outlook mail item using Word 2003 as the email editor, can I specify the font to be used in my vba macro code? Right now it pulls whatever the user has set as the default in Word under Tools Options General Email Options Personal Stationary. I tried the code listed below, but it has no effect. Thanks for any suggestions. Set oItem = oOutlookApp.CreateItem(olMailItem) With oItem .To = " .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 .Font.Name = "Verdana" .Send End With |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
how do I change the font face and size for whole text in .eml | zero | Outlook Express | 3 | December 2nd 08 07:08 PM |
Font issues between Word and Outlook | Koons | Outlook - General Queries | 0 | April 18th 07 10:37 PM |
Outlook macro abends but Word macro runs successfully | Jreue | Outlook and VBA | 0 | December 14th 06 12:55 AM |
Outlook Express type face/font settings. | Alan | Outlook Express | 3 | December 8th 06 01:05 PM |
Macro to change font of selected text in mail message? | Joe HM | Outlook and VBA | 1 | April 6th 06 07:06 PM |