Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / October 2005

Tip: Looking for answers? Try searching our database.

Problem writing Body property to a new Contact

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack Black - 05 Oct 2005 16:55 GMT
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
Sue Mosher [MVP-Outlook] - 17 Oct 2005 21:26 GMT
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.

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx

> 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...
[quoted text clipped - 21 lines]
> Thoughts?  Thanks!
> Jack
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.