PC Review


Reply
Thread Tools Rate Thread

Copy a MAPI item to a PST

 
 
Scupper
Guest
Posts: n/a
 
      8th Mar 2004
I am doing large searches through our Exchange store and copying the
messages to a subfolder of my Inbox using VB.NET. The problem with this is
that each time it copies a message, Exchange wants to virus scan it and the
server admin does not think he can disable that just for this process. So,
I am trying instead to copy the messages to a PST file I have set up on my
workstation.

Unfortunately, I cannot seem to get MAPI to talk to the PST file. Only
Outlook (2000)-based calls will go to it, but Outlook refuses to allow me
to edit items I create, nor will it copy the messages if they are passed to
it in MAPI.Message form.

I have tried:

oItem = MAPI.Message (passed into the function)


Dim oCopy As Outlook.MAPIMessage
oCopy = oWorkingFolder.Items.Add()

oCopy.Sender = oItem.Sender (gives me a message that
Outlook.MAPIMessage.Sender is read-only)


I have also tried:

oItem.CopyTo(sFolderID,sStoreID)

Passing what outlook returns as the folder and store ID, but MAPI then
cannot find the folder.



Any help would be much appreciated.
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      9th Mar 2004
When you say MAPI do you mean CDO 1.21? If so you can't just assign an
Outlook item to a CDO item. You have to get the EntryID of the item and
possibly the StoreID of the MAPIFolder where the item lives and use CDO's
Session.GetMessage(strEntryID, strStoreID) method.

The CDO CopyTo method would use the Outlook MAPIFolder.EntryID and StoreID
properties.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Scupper" <scupperAThotmailDOTcom> wrote in message
news:Xns94A6907764222scupperhotmailcom@207.46.248.16...
> I am doing large searches through our Exchange store and copying the
> messages to a subfolder of my Inbox using VB.NET. The problem with this is
> that each time it copies a message, Exchange wants to virus scan it and

the
> server admin does not think he can disable that just for this process. So,
> I am trying instead to copy the messages to a PST file I have set up on my
> workstation.
>
> Unfortunately, I cannot seem to get MAPI to talk to the PST file. Only
> Outlook (2000)-based calls will go to it, but Outlook refuses to allow me
> to edit items I create, nor will it copy the messages if they are passed

to
> it in MAPI.Message form.
>
> I have tried:
>
> oItem = MAPI.Message (passed into the function)
>
>
> Dim oCopy As Outlook.MAPIMessage
> oCopy = oWorkingFolder.Items.Add()
>
> oCopy.Sender = oItem.Sender (gives me a message that
> Outlook.MAPIMessage.Sender is read-only)
>
>
> I have also tried:
>
> oItem.CopyTo(sFolderID,sStoreID)
>
> Passing what outlook returns as the folder and store ID, but MAPI then
> cannot find the folder.
>
>
>
> Any help would be much appreciated.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a Contact item using MAPI Ivan Microsoft Outlook Contacts 1 17th Mar 2008 12:44 PM
Create a Contact item using MAPI Ivan Microsoft Outlook Program Addins 1 16th Mar 2008 07:51 AM
Adding a header item with MAPI =?Utf-8?B?VG9tIGF0IEdTRA==?= Microsoft Outlook Program Addins 6 8th Jan 2007 06:42 PM
Send.Item message when using mapi emailing James Microsoft Outlook 1 27th Jul 2004 07:21 PM
outlook mail item to MAPI store item Omar Microsoft Outlook Program Addins 2 8th Oct 2003 05:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:26 AM.