MAPI - EntryID Number vbscript code help

  • Thread starter Thread starter Paul Johnson
  • Start date Start date
P

Paul Johnson

I have a third party program that works well with my install off Outlook
2003. and currently they have no way to preload some of the configuration
settings.

Some of the settings are:

Using the MAPI Com object the Entry ID for
Contacts Folder
Calendar Folder
Notes Folder
Tasks Folder

The company stores there settings in the %USERPROFILE%\Application
Data...... for each user
adn a *.ini file.

I have a vbscript that creates the *.ini file with the apropriate
information with the exception of the EntryID's

Can someone help me by provideing the code to look this information up and
save it as a variable so i can add it to my code to write this information
to my *.ini file

Thank you

Paul
 
Dim oContacts As Outlook.MAPIFolder
Dim oCalendar As Outlook.MAPIFolder
Dim oNotes As Outlook.MAPIFolder
Dim oTasks As Outlook.MAPIFolder
Dim oOL As Outlook.Application
Dim strIDContacts As String
Dim strIDCalendar As String
Dim strIDNotes As String
Dim strIDTasks As String
Dim strStoreID As String

Set oOL = CreateObject("Outlook.Application")

Set oCalendar = oOL.Session.GetDefaultFolder(olFolderCalendar)
strIDCalendar = oCalendar.EntryID

strStoreID = oCalendar.StoreID

Set oContacts = oOL.Session.GetDefaultFolder(olFolderContacts)
strIDContacts = oContacts.EntryID

Set oNotes = oOL.Session.GetDefaultFolder(olFolderNotes)
strIDNotes = oNotes.EntryID

Set oTasks = oOL.Session.GetDefaultFolder(olFolderTasks)
strIDTasks = oTasks.EntryID
 
I cut and paste'd the code you so generously provided and saved it to a file
named ID.vbs and tried to run it on a windows 2000 sp4 computer with office
2003 installed and it return errors

Did I do something incorrectly

Paul
 
I cut and paste'd the code you so generously provided and saved it to a file
named ID.vbs and tried to run it on a windows 2000 sp4 computer with office
2003 installed and it return errors

Did I do something incorrectly

Paul
 
Sorry, I forgot you wanted VBScript code. VBScript has no early bound data
types. Just put comment marks before each As clause:
Dim oContacts 'As Outlook.MAPIFolder
and so on.
 
Back
Top