Problem writing Body property to a new Contact

  • Thread starter Thread starter Jack Black
  • Start date Start date
J

Jack Black

Hi, all! Trying to locate an answer as to why attempts to write info to the
..Body property of the ContactItem object (CreateItem method) is failing...
Code follows:

Dim oCT As Outlook.ContactItem =
oApp.CreateItem(Outlook.OlItemType.olContactItem)
With sttUser
If .strFullName <> "" Then oCT.FullName = .strFullName
If .strFirstName <> "" Then oCT.FirstName = .strFirstName
If .strNote <> "" Then oCT.Body = .strNote
If .strTitle <> "" Then oCT.Title = .strTitle
' Lines removed for brevity
oCT.Save()
End With

"sttUser" is a structure that contains data imported from another contact
manager application; some lines have been deleted to save bandwidth. There
are no errors thrown during the Save operation, and all data (except .Body)
are written correctly. I know the variable contains good data because I can
write the same information to other text fields (such as the User Defined
fields in the Contact object) without a problem. It's just the .Body
property that refuses to accept data.

Thoughts? Thanks!
Jack
 
This may sound trivial, but the most logical explanations would be that sttUser.strNote contains an empty string or that some other statement overwrites the Body property with an empty string.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top