Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outlook PST Files
Message
 
To
19/01/2009 10:57:51
General information
Forum:
Visual FoxPro
Category:
Third party products
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01374986
Message ID:
01375095
Views:
19
This message has been marked as a message which has helped to the initial question of the thread.
>>>Hi All,
>>>
>>>Using COM automation how can I open an Outlook PST file and close it again? I see how I can parse folders and emails of an existing "store" but not sure how to open a PST file and close it again.
>>>
>>>I see that AddStore will open a PST file. How to close it though?
>>>
>>>TIA
>>
>>Like:
>>
>>=myNameSpace.RemoveStore(myNameSpace.Folders(6))
>
>Thanks Yuri. What is the easiest way to know which store number is the store I just added? i.e. in your example Folders(6) ?


As an example:
lcFolderPath="c:\outlook\archive.pst"
lo=GETOBJECT(,"Outlook.Application")
WITH lo.GetNamespace("MAPI")
	ln=.Folders.Count
	.AddStore(lcFolderPath)
	* do whatever you need to do
....

	.RemoveStore(.Folders(ln+1))
ENDWITH
lo=null
You may refer to Folder Name, folder index, Folder entry ID. I would use Folder entry ID since there could be several folders having the same name, there may be other folders added/removed, or folders may be reorganized. With folder entry ID you need to scan folders checking their ID to get it.

Best Wishes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform