Export Folder or "Items"-Collection?

M

Michael

Hello:)

I want to export some Items of my Calendar and Contacts to an external File
on my harddisk and to move it to an other PC and import the Items into a
Folder again.
With Outlook 2003 - no problem! But I want to automate this process and
don't know how to write it in VBA!? I already wrote code witch makes, from
every Item I want to move, an file (with "save as" function from every
Item). But this is VERY slow when I try to export a large amount of Items
500! So I thought of exporting the whole collection (Even the whole Folder
is OK for me!)I tryed to serialize the Items-Collection with VB .Net (wrote
an Outlook Add-in) but the "Items"-object is not marked as serializable.
So if anybody knows how to use the Function "File->Import/Export->Export to
a file->...pst->" and the other way back with VBA or if anybody has a better
or other Idee for moving fast the whole folder or Itemcoll. from one Outlook
to an other Outlook- please let me know

Thank you very much in advance for your efforts.

- Michael
 
S

Sue Mosher [MVP-Outlook]

Sounds like you're saving a file for each item, which certainly will be
slow. The Import and Export Wizard can't be automated. For export code
samples, see http://www.outlookcode.com/d/customimport.htm . Note that the
MAPIFolder object has a CopyTo method.


--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

Michael

The CopyTo Method only allows me to save the Items in a other Folder in the
same outlook not for exporting to a other machine with a other outlook! So I
cant use this function for exporting!?
The examples at "http://www.outlookcode.com/d/customimport.htm" are mostly
for exporting only a few Attributes per Item. But I want a full copy of
Appointmentitems and Contactitems. For example a Appointmentitem could
contain several other objects like recuring- and attachements objects. So
the way of saving the Attributes is may the wrong.
May there is a way for converting the whole Itemobject in a "coveringclass"
to serialize it!?! I'm not sure about this Idee! better ones?

Michael
 
S

Sue Mosher [MVP-Outlook]

You said that you wanted to export to an external file on your hard disk.
You certainly can do that with MAPIFolder.CopyTo if the external file is a
..pst file that you've added to your profile either manually or with the
Namespace.AddStore method.

The other code samples give you the basics of how to iterate folders and
items. If you want to iterate and copy items intact to a .pst file (much
more tedious than MAPIFolder.CopyTo), you use the Copy method on each item
to create a copy, then the Move method to move the copy to the desired
folder.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

Michael

Thank you:) Havent known about the possibility to move it to an external
pst. file:) Hope this will work.

Have fun...
Michael
 

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