MailItem And Rich Text Format

M

Mita Garg

Hi All,

I am programtically trying to send message. But it always sets it to
"rich text Format". How do I set it to "Plain Text"

Here is my code:

Private Sub OKButton_Click()

Dim objItem As Object
Dim colRecipients As MAPI.Recipients
Dim objRecipient As MAPI.Recipient
Dim objAddressEntry As MAPI.AddressEntry
Dim name As String
Dim number As String
Dim company As String
Dim strFormattedString As String
Dim objRec As Outlook.Recipient
Dim n As Integer
Dim oAddressEntry As Outlook.AddressEntry

' open the Address Book
Set objItem = golApp.ActiveInspector.CurrentItem
'.CreateItem(olMailItem)
Set colRecipients = gobjCDO.AddressBook(Title:="Select Names",
ParentWindow:=Me.hwnd)
For Each objRecipient In colRecipients
Set objAddressEntry = objRecipient.AddressEntry
name = ""
name = objAddressEntry.Fields(CdoPR_DISPLAY_NAME).Value
number = ""
company = objAddressEntry.Fields(CdoPR_COMPANY_NAME).Value
number = ""
number = objAddressEntry.Fields(CdoPR_PRIMARY_FAX_NUMBER).Value
If (number = "") Then
number = objAddressEntry.Fields(CdoPR_BUSINESS_FAX_NUMBER).Value
End If
strFormattedString = name + "@" + company + "@" + number
With objRecipient
.name = "[FAX:" + strFormattedString + "]"
Set objAddressEntry = .AddressEntry
With objAddressEntry
.Fields(CdoPR_SEND_RICH_INFO) = False
.Update
End With
.AddressEntry = objAddressEntry
End With
objRecipient.Type = 1
objRecipient.Resolve
objItem.Recipients.Add (objRecipient.name)
objRecipient.Resolve
Next
objItem.Recipients.ResolveAll
objItem.Display
objItem.Recipients.ResolveAll
colRecipients.Resolve
Unload Me

Your help will be appreciated.
Thanks Mita
 

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