MAPI - EntryID Number vbscript code help

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
 
K

Ken Slovak - [MVP - Outlook]

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
 
P

Paul Johnson

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
 
P

Paul Johnson

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top