View Single Post
  #2  
Old June 5th 06, 06:21 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 1,521
Default Read contents of Note inserted in Outlook Contact Item Body

Your code displays the Attachment.DisplayName property, which happens to the
default Attachment object property.
DisplayName property for the embedded message attachments is the value of
the message's subject, which in case of the NoteItem is set to the very
first line of the body.

You cannot easily access embedded message attachments in the Outlook Object
Model (unless you save teh atatchment as an MSG file).
Such messages can be accessed using Extended MAPI (does not work with VB),
CDO 1.21 (Attachment.Source.Body) or Redemption
(Attachment.EmbeddedMsg.Body).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"JPL" wrote in message
news
The following code successfully displays the first line of a Note attached
to
a Contact Item:

Set objNotesColl = objContactItem.Attachments
If objNotesColl.Count 0 Then
MsgBox objNotesColl.Count & " items found for " &
objContactItem.FullName
For Each objNote In objNotesColl
MsgBox objNote
Next objNote
End If

However, I wish to access the entire contents of the Note (objNote.Body),
not just the subject, and this does not work. Nor does reading the
Subject
explicitly, i.e. "MsgBox objNote" works, but "MsgBox objNote.Subject"
results
in a run-time error.

How can the entire contents of a Note be read?

JPL



Ads
 

Internet Advertising - Credit Monitoring - Homeowner Loans - Credit Cards UK - Credit Card