How to Find a Item using VBScript in Outlook/Exchange

A

Andrew Sampels

I'm use to doing this via VB and CDO but I can't seem to find a simple
way in VBScript from a form itself. I have a EntryID for an Item and
wish to find the corresponding Item. I have setup my collection down to
the item level and can use a loop to find and setup the item but it's
slow. On the VB side you can use the
GetMessage(ID,ParentFolderSessionID) command from the Connection to go
directly to an Item. Is there an equivalent in the Form design mode
using VBScript?

When I use the Folder.Find() command it tells me that the EntryID is not
Valid Along with just ID like I can use via CDO. Is it possibly labeled
something different?

Any help would be appreciated.


*** Sent via Developersdex http://www.developersdex.com ***
 
S

Sue Mosher [MVP-Outlook]

Why not use the Namespace.GetItemFromID method?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
H

Hollis Paul [MVP - Outlook]

Andrew Sampels said:
Sorry, I'm new and trying to learn the methods. I will research it. Do
you mind giving me a quick example or code snipit? Thanks Sue
The first thing you should research is Sue's site --


The second thing to look at is www.Slipstick.com ; lots of examples
there also. Then you might look at
http://www.outlookbythesound.com/SBS2003/12frameset_outlook.htm . Each
of those blossoms in the hands of Devi have a URL to an Outlook or other
important resource. The one by the left ear, your left, not Devi's,
will point you to the list of known MVP websites. You can get lost once
you get there.
 
A

Andrew Sampels

This is where I am on this. I have it working but had to find my public
root ID using VB and then set it up as a string. Is there a way to find
it using the VBScript? Here is my code snipit.

Set objNameSpace = Application.GetNameSpace("MAPI")

test =
"0000000038A1BB1005E5101AA1BB08002B2A56C20000454D534D44422E444C4C0000000
0000000001C830210AA6611CD9BC800AA002FC45A0600000049495300D83521F38B00000
001000000140000006B0000002F6F3D4669727374204F7267616E697A6174696F6E2F6F7
53D46697273742041646D696E6973747261746976652047726F75702F636E3D436F6E666
96775726174696F6E2F636E3D536572766572732F636E3D494953006900690073002E004
6004D0043004F002E006C006F00630061006C0000000000"

^ My Public Root ID ^

Set Message = objNameSpace.GetItemFromID( ItemID,Test)



*** Sent via Developersdex http://www.developersdex.com ***
 
S

Sue Mosher [MVP-Outlook]

By "public root ID," do you mean the StoreID for the Public Folders
hierarchy? You can get that programmatically by walking the folder hierarchy
from Application.Session.Folders down into the Public Folders hierarchy and
getting the StoreID from the first folder under Public Folders\All Folders.
 

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