PC Review


Reply
Thread Tools Rate Thread

Re: How do I find who created a contact item in a public folder?

 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      2nd Jul 2003
You can use CDO 1.21 or Redemption (www.dimastr.com/redemption) code
to find that using the PR_CREATOR_NAME property tag.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


"Bruce" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> When I open a contact record (in outlook), I can see who created the
> record by clicking on the "All Fields" tab and selecting "All Post
> Fields". In the resulting list, the "From" field seems to contain
> the name of the user that created the record. My question is
> this...How can I read this information programmatically? I don't

see
> any ContactItem property that corresponds to this information.



 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      7th Jul 2003
There is nothing in the Outlook object model that gives you that
information. CDO, Redemption or Extended MAPI (C++ or Delphi only) are
the only ways to go.

CDO 1.21 is an optional installation with Outlook 2000 and later, make
sure it's installed and you have a reference to it set in the project.

For use with CDO:

Sub GetCreator()
'requires the item be open for this sample

Const PR_CREATOR_NAME = &H3FF8001E

Dim oContact As Outlook.ContactItem
Dim oInspector As Outlook.Inspector
Dim oOL As Outlook.Application

Dim oCDO As MAPI.Session
Dim oMessage As MAPI.Message
Dim oFields As MAPI.Fields
Dim oField As MAPI.Field

Dim sEntryID As String
Dim sStoreID As String

On Error Resume Next

Set oOL = CreateObject("Outlook.Application")
Set oInspector = oOL.ActiveInspector
Set oContact = oInspector.CurrentItem

sEntryID = oContact.EntryID
sStoreID = oContact.Parent.StoreID

Set oCDO = CreateObject("MAPI.Session")
oCDO.Logon "", "", False, False

Set oMessage = oCDO.GetMessage(sEntryID, sStoreID)
Set oFields = oMessage.Fields
Set oField = oFields(PR_CREATOR_NAME)

MsgBox oField.Value 'display the creator

oCDO.Logoff
'set all objects = Nothing here
End Sub

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


"Bruce" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks for the response, but it didn't help. Is there a way to
> access the property through Outlook automation? I tried using CDO
> 1.21, but I can't seem to access the "Fields" property that I need

to
> try to use the property tags. (an example would be appreciated).
>
> As far as using Redemption...I really do not want to use a

commercial
> control--especially just to access one bit of information.



 
Reply With Quote
 
Bruce
Guest
Posts: n/a
 
      8th Jul 2003
Thanks Ken!
I found my office cd, and installed the CDO. Your sample code
gave me everything I needed. I appreciate your help.



"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message news:<#(E-Mail Removed)>...
> There is nothing in the Outlook object model that gives you that
> information. CDO, Redemption or Extended MAPI (C++ or Delphi only) are
> the only ways to go.
>
> CDO 1.21 is an optional installation with Outlook 2000 and later, make
> sure it's installed and you have a reference to it set in the project.
>
> For use with CDO:
>
> Sub GetCreator()
> 'requires the item be open for this sample
>
> Const PR_CREATOR_NAME = &H3FF8001E
>
> Dim oContact As Outlook.ContactItem
> Dim oInspector As Outlook.Inspector
> Dim oOL As Outlook.Application
>
> Dim oCDO As MAPI.Session
> Dim oMessage As MAPI.Message
> Dim oFields As MAPI.Fields
> Dim oField As MAPI.Field
>
> Dim sEntryID As String
> Dim sStoreID As String
>
> On Error Resume Next
>
> Set oOL = CreateObject("Outlook.Application")
> Set oInspector = oOL.ActiveInspector
> Set oContact = oInspector.CurrentItem
>
> sEntryID = oContact.EntryID
> sStoreID = oContact.Parent.StoreID
>
> Set oCDO = CreateObject("MAPI.Session")
> oCDO.Logon "", "", False, False
>
> Set oMessage = oCDO.GetMessage(sEntryID, sStoreID)
> Set oFields = oMessage.Fields
> Set oField = oFields(PR_CREATOR_NAME)
>
> MsgBox oField.Value 'display the creator
>
> oCDO.Logoff
> 'set all objects = Nothing here
> End Sub
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Lead Author, Professional Outlook 2000 Programming, Wrox Press
> Lead Author, Beginning VB 6 Application Development, Wrox Press
> Attachment Options
> http://www.slovaktech.com/attachmentoptions.htm
> Extended Reminders
> http://www.slovaktech.com/extendedreminders.htm
>
>
> "Bruce" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Thanks for the response, but it didn't help. Is there a way to
> > access the property through Outlook automation? I tried using CDO
> > 1.21, but I can't seem to access the "Fields" property that I need

> to
> > try to use the property tags. (an example would be appreciated).
> >
> > As far as using Redemption...I really do not want to use a

> commercial
> > control--especially just to access one bit of information.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
outlook07: (exchange) public folder favorites contact, find =?Utf-8?B?UGF1bCBBYmJpdA==?= Microsoft Outlook Contacts 0 7th Nov 2007 11:48 AM
Searching a contact folder created in Public Folders fails. =?Utf-8?B?QmVuIE1jS2VsbGFy?= Microsoft Outlook Contacts 0 12th Mar 2006 11:26 PM
Why don't I show a master cat our spvsr created in public contact =?Utf-8?B?VHZsbWdyU0o=?= Microsoft Outlook Contacts 1 30th Jan 2006 03:16 PM
Using Public Folder Favorites vs. Public Folder Item =?Utf-8?B?U3V6YW5uOTg=?= Microsoft Outlook Discussion 3 7th Feb 2005 10:20 PM
Form not being used in public folder when item opened as Find result. Anonymous Coward Microsoft Outlook Form Programming 1 20th Apr 2004 01:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:29 PM.