Outlook Contacts ... Changing Font Size, Style, Bold, etc.

trhenkel

New Member
Outlook version
Outlook 2016 64 bit
Email Account
POP3
I am trying to access and change the properties of the .Body for my existing (3,000+) Outlook Contacts. (Not E-Mail Body, but Contacts - and also Calendar Items if it apples - Body.) I have written the following code, but I cannot find any reference to Properties, etc. which would allow me to change the Font Size, Font Style, Bolding, Underlining, etc. for the .Body.

Public Sub Access_Contact_Body()
Dim Session As Outlook.NameSpace 'Defines the NameSpace
Dim ContactsFolder As Outlook.folder 'The Contacts folder
Dim objContact As Object 'One contact

Set Session = Application.Session
Set ContactsFolder = Session.GetDefaultFolder(olFolderContacts) 'Sets the folder to Contacts

For Each objContact In ContactsFolder.Items 'Iterates through all the Contacts
With objContact 'Using the Contact item
'Exclude all DistListItem (or Groups) ...
If TypeOf objContact Is DistListItem = False Then

If .Body <> "" Then Stop

'HOW DO I ACCESS AND CHANGE THE FONT SIZE, FONT STYLE, BOLD, UNDERLINE, ETC.

End If
End With
Next
Set Session = Nothing 'Cleans up the variable
Set ContactsFolder = Nothing 'Cleans up the variable
Set objContact = Nothing 'Cleans up the variable
End Sub

Can anyone help?

PS: Forgive me if this isn't the proper way to post a question.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
i have a sample here - you need to use inspector and word vba to change it.
 

trhenkel

New Member
Outlook version
Outlook 2016 64 bit
Email Account
POP3
i have a sample here - you need to use inspector and word vba to change it.
Diane, thanks so much. I have adapted that code to work through all the Contacts and make changes.

Follow up question:

Some of the Notes section for my Contacts (.Body) are already formatted in certain specific ways. For instance, part of the .Body for a single Contact might have a .Font.Size =12, and another part of that same .Body might have a .Font.Size =18. Using your Inspector / WordEditor technique, is there some way to re-format each section separately so that, for instance, the existing .Font.Size =12 area becomes .Font.Size =16 and the existing .Font.Size =18 area becomes .Font.Size =20? (I am really asking the more general question about identifying blocks of text which are formatted in a certain way and working with those blocks to change the properties.)

Thanks again for your expertise and help.
 
Top