Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Determine EntryID (http://www.outlookbanter.com/outlook-vba/67504-determine-entryid.html)

Question Boy February 25th 08 01:00 AM

Determine EntryID
 
Hello,

i am creating a new contact using vba

************
Set objFolder = myNameSpace.GetDefaultFolder(olFolderContacts)
Set objItems = objFolder.Items

With objItems.Add 'Create new Contact Entry
.FirstName = ""
.LastName = ""
.HomeAddressStreet = "
'...
.Save
***********

How do I determine the EntryID of the newly created contact at it creation
so I can store it?

Thank you,

QB
End With

Michael Bauer [MVP - Outlook] February 25th 08 06:07 AM

Determine EntryID
 


You don't set the ID yourself. Call the item's Save method, then yo can read
the EntryID created by Outlook.

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Sun, 24 Feb 2008 17:00:00 -0800 schrieb Question Boy:

Hello,

i am creating a new contact using vba

************
Set objFolder = myNameSpace.GetDefaultFolder(olFolderContacts)
Set objItems = objFolder.Items

With objItems.Add 'Create new Contact Entry
.FirstName = ""
.LastName = ""
.HomeAddressStreet = "
'...
.Save
***********

How do I determine the EntryID of the newly created contact at it creation
so I can store it?

Thank you,

QB
End With


Question Boy February 25th 08 11:20 AM

Determine EntryID
 
Michael,

That is exactly my question. How can one do that, detrmine the EntryID of a
newly created contact item?

After the .save how can I determine and pass the EntryID for the newly
created contact item to a variable?

Thank you,

QB




"Michael Bauer [MVP - Outlook]" wrote:



You don't set the ID yourself. Call the item's Save method, then yo can read
the EntryID created by Outlook.

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Sun, 24 Feb 2008 17:00:00 -0800 schrieb Question Boy:

Hello,

i am creating a new contact using vba

************
Set objFolder = myNameSpace.GetDefaultFolder(olFolderContacts)
Set objItems = objFolder.Items

With objItems.Add 'Create new Contact Entry
.FirstName = ""
.LastName = ""
.HomeAddressStreet = "
'...
.Save
***********

How do I determine the EntryID of the newly created contact at it creation
so I can store it?

Thank you,

QB
End With



Michael Bauer [MVP - Outlook] February 26th 08 05:36 AM

Determine EntryID
 


After it's stored you can read the property like this:

Dim objItems as Outlook.Items
Dim Contact as Outlook.ContactItem
Dim ID$

Set Contact=objItems.Add
Contact.Save
ID = Contact.EntryID

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:
http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Mon, 25 Feb 2008 03:20:03 -0800 schrieb Question Boy:

Michael,

That is exactly my question. How can one do that, detrmine the EntryID of

a
newly created contact item?

After the .save how can I determine and pass the EntryID for the newly
created contact item to a variable?

Thank you,

QB




"Michael Bauer [MVP - Outlook]" wrote:



You don't set the ID yourself. Call the item's Save method, then yo can

read
the EntryID created by Outlook.

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:

http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6

Am Sun, 24 Feb 2008 17:00:00 -0800 schrieb Question Boy:

Hello,

i am creating a new contact using vba

************
Set objFolder = myNameSpace.GetDefaultFolder(olFolderContacts)
Set objItems = objFolder.Items

With objItems.Add 'Create new Contact Entry
.FirstName = ""
.LastName = ""
.HomeAddressStreet = "
'...
.Save
***********

How do I determine the EntryID of the newly created contact at it

creation
so I can store it?

Thank you,

QB
End With




All times are GMT +1. The time now is 10:36 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com