A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Determine EntryID



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 25th 08, 02:00 AM posted to microsoft.public.outlook.program_vba
Question Boy
external usenet poster
 
Posts: 20
Default 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
  #2  
Old February 25th 08, 07:07 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default 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

  #3  
Old February 25th 08, 12:20 PM posted to microsoft.public.outlook.program_vba
Question Boy
external usenet poster
 
Posts: 20
Default 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


  #4  
Old February 26th 08, 06:36 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default 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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EntryID problem vonClausowitz Outlook and VBA 3 August 23rd 07 04:31 PM
EntryID Ela Outlook and VBA 2 April 13th 07 01:10 AM
Invalid ENTRYID??? Sandy Outlook - Using Contacts 3 July 20th 06 11:08 PM
EntryID is nothing donald Add-ins for Outlook 2 March 20th 06 06:08 PM
EntryID Arne Baldauf Outlook and VBA 3 February 4th 06 06:41 PM


All times are GMT +1. The time now is 07:00 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-2025 Outlook Banter.
The comments are property of their posters.