![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Create an instance of the MAPI.Session object,
set Session.MAPIOBJECT property to Namespace.MAPIOBJECT from OOM Reopen the message in CDO 1.21 using Session.GetMessage and the valeu of teh MailItem.EntryID Read the Message.Sender property (returnsd AddressEntry). Use AddressEntry.Fields[] to access the required propeties - you can get the props tags from OutlookSpy (e.g. click IMAPISession | QueryIdentity) -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "_M_a_t_t_" wrote in message ... The contact does not exist in the local address book. What I want to access is the contact information you can access when right clicking on From name and choosing Outlook Properties. With non exchange senders, you Display name, E-mail address, E-mail type, and Internet format. When its an Exchange mail, you get (provided entered), shipping address, phone number(s), country etc. Its this information I'd like to access directly from the Email (as the contact isn't in the local address book, and I'm reading in, parcing and displaying information from the email). However, I can not install additional plug-ins. I need to be able to do this with what Outlook already has. I'm assuming this can be done with Microsoft CDO 1.21 Reference and/or MAPI, but I need an example of how to access the information from the email and contact in 1 loop (or perhaps via a sub function called from the main loop. Again I'm currently using this formation to read out the information from the Email: Dim olkItem As Outlook.MailItem For Each olkItem In Application.ActiveExplorer.Selection 'Read the info and enter it into the dialog 'Example info: MsgBox olkItem.SenderEmailAddress Next And this works fine (as long as only 1 mail is selected, more then one causes problems, since each would be processed, but only the last selected would actually be displayed). Matt "Dmitry Streblechenko" wrote: So d oyo uwant to access EX specific properties of a contact that was create in the hContacts folder from one of the GAL entries? Or EX properties of a message sender/recipient? -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - |
#2
|
|||
|
|||
![]()
Thanks for the update Dmitry, however I do not understand what you are
refering to nor how to do what you have stated (I say that I need an example previously) ..... Any chance you can post a small example? |
#3
|
|||
|
|||
![]()
I don't have CDO 1.21 installed here, so the script below uses Redemption
set Session = CreateObject("Redemption.RDOSession") Session.MAPIOBJECT = Application.Session.MAPIOBJECT for each Item in Application.ActiveExplorer.Selection set RDOItem = Session.GetMessagefromID(Item.EntryID) set Sender = RDOItem.Sender if not (Sender Is Nothing) Then MsgBox Sender.City end if next The next script is using CDO 1.21, but I did not have a chance to actually test it set Session = CreateObject("MAPI.Session") Session.MAPIOBJECT = Application.Session.MAPIOBJECT for each Item in Application.ActiveExplorer.Selection set CDOItem = Session.GetMessage(Item.EntryID) set Sender = CDOItem.Sender if not (Sender Is Nothing) Then MsgBox Sender.City end if next -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "_M_a_t_t_" wrote in message ... Thanks for the update Dmitry, however I do not understand what you are refering to nor how to do what you have stated (I say that I need an example previously) ..... Any chance you can post a small example? |
#4
|
|||
|
|||
![]()
Thanks Dmitry, regretfully the CDO example doesn't work... I get an error on
MAPIOBJECT: "Method or data member not found (Error 461)".... |
#5
|
|||
|
|||
![]()
Do you get that error on reading the Application.Session.MAPIOBJECT or
setting the Session.MAPIOBJECT property. Where does your code run? -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "_M_a_t_t_" wrote in message ... Thanks Dmitry, regretfully the CDO example doesn't work... I get an error on MAPIOBJECT: "Method or data member not found (Error 461)".... |
#6
|
|||
|
|||
![]()
I get the error on:
Session.MAPIOBJECT = Application.Session.MAPIOBJECT Regretfully the help isn't 'helpful' here, since I can't find any information about this, or what would be 'correct'..... |
#7
|
|||
|
|||
![]()
That line contains two statements. One is reading the property. Another one
is setting it. Can you break that line in two to see which one fails? set temp = Application.Session.MAPIOBJECT Session.MAPIOBJECT = temp Is this Access? If, Session intrinsic variable points to an Access object. Rename the Session variable in the script to somethign like CDOSession. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "_M_a_t_t_" wrote in message ... I get the error on: Session.MAPIOBJECT = Application.Session.MAPIOBJECT Regretfully the help isn't 'helpful' here, since I can't find any information about this, or what would be 'correct'..... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook Contacts Macro to Change Info | Jason | Outlook and VBA | 1 | November 13th 08 11:57 PM |
Macro to rename Subject of E-mail on exchange server(2007) | Ryan Arnold | Outlook and VBA | 4 | October 6th 08 03:30 AM |
outlook 2003 macro to extract calendar appointment info to Excel | CPOjoe | Outlook - Calandaring | 3 | July 15th 08 04:04 PM |
retrieving Outlook user info from Word macro | IndianSummer | Outlook and VBA | 1 | September 29th 07 12:05 AM |
Importing Outlook Alias info into an excel 2003 macro | fidgitthedigit | Outlook and VBA | 4 | May 31st 06 04:22 PM |