Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook PST Files
Message
 
À
19/01/2009 10:57:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01374986
Message ID:
01375095
Vues:
13
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform