Opening a *.pst file via code 
Author Message
 Opening a *.pst file via code

This code can be used to create new folders in Outlook from Access

Dim appOutlook As New Outlook.Application

Dim nms As Outlook.NameSpace

Dim flds As Outlook.Folders

Dim fld As Outlook.MAPIFolder

Dim exp As Outlook.Explorer

Dim ins As Outlook.Inspector

Declare this variable as Object so it can be used for any type of item

Dim itm As Object

Declare these variables as specific item types

Dim msg As Outlook.MailItem

Dim con As Outlook.ContactItem

Set nms = appOutlook.GetNamespace("MAPI")

Set a reference to the top level folder "Personal Folders"

Set flds = nms.Folders("Personal Folders").Folders

Set a reference to a folder called "Custom Contacts" under the top-level
Personal Folders folder's Folders collection (via the previously set flds
variable)

Set fld = flds("Custom Contacts")

Add a new folder under the "Custom contacts" folder

Set myNewFolder = fld.Folders.Add("My Contacts")



Quote:
> Is there a way to programically open & close a *.pst file?
> I'm developing functionality that will allow Access to
> create & remove Outlook folders in various *.pst files. I
> need the ability to open a *.pst file if the *.pst file is
> not currently open.



Tue, 17 May 2005 18:46:13 GMT  
 Opening a *.pst file via code
Thank you, however your response did not answer the
question. Creating folders is not the issue. The issue
lies with creating a *.pst file.

Quote:
>-----Original Message-----
>This code can be used to create new folders in Outlook
from Access

>Dim appOutlook As New Outlook.Application

>Dim nms As Outlook.NameSpace

>Dim flds As Outlook.Folders

>Dim fld As Outlook.MAPIFolder

>Dim exp As Outlook.Explorer

>Dim ins As Outlook.Inspector

>Declare this variable as Object so it can be used for any
type of item

>Dim itm As Object

>Declare these variables as specific item types

>Dim msg As Outlook.MailItem

>Dim con As Outlook.ContactItem

>Set nms = appOutlook.GetNamespace("MAPI")

>Set a reference to the top level folder "Personal Folders"

>Set flds = nms.Folders("Personal Folders").Folders

>Set a reference to a folder called "Custom Contacts"
under the top-level
>Personal Folders folder's Folders collection (via the
previously set flds
>variable)

>Set fld = flds("Custom Contacts")

>Add a new folder under the "Custom contacts" folder

>Set myNewFolder = fld.Folders.Add("My Contacts")


message

>> Is there a way to programically open & close a *.pst
file?
>> I'm developing functionality that will allow Access to
>> create & remove Outlook folders in various *.pst files.
I
>> need the ability to open a *.pst file if the *.pst file
is
>> not currently open.

>.



Tue, 17 May 2005 23:30:36 GMT  
 Opening a *.pst file via code
Any other bites?
Quote:

> Is there a way to programically open & close a *.pst file?
> I'm developing functionality that will allow Access to
> create & remove Outlook folders in various *.pst files. I
> need the ability to open a *.pst file if the *.pst file is
> not currently open.



Wed, 18 May 2005 04:28:21 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Creating a *.pst file via code

2. Exporting everything to pst file via code

3. Code for opening .pst file

4. Opening .PST via VB6 & ADO

5. Exporting/Importing pst files via VBA

6. Updating a PST file via network login and auto-importing into Outlook 2000

7. Open & Close pst files with VBA

8. Opening a personal file store (.pst) using VB6.0

9. how can i close an opened PST File

10. Open & Close pst files with VBA

11. How to open a Contact folder in a PST file

12. Can you open a .PST file with VBScript?

 

 
Powered by phpBB® Forum Software