General discussion

Locked

Copy .msg file back into Outlook 2000

By IT_Cowboy ·
I have an urgent need to copy a stack of .msg files back into Outlook 2000 (each message was saved to the hard drive as separate .msg files and removed from Outlook).

I know you can use the "Copy to Folder..." option on the file menu for each, but its going to take forever and a couple of days to copy back over 2000 of them.

Can anyone shed some light onto this problem. Because the file is external, I cannot work out how to assign it to an Outlook mailitem object to perform the copy.

Perhaps I am going about it the wrong way. Any help would be greatly appreciated.

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Copy .msg file back into Outlook 2000

by SyscoKid In reply to Copy .msg file back into ...

I was able to save a number of .msg files to my hard drive, then open Windows Explorer, highlight them all, and drag and drop them into my inbox.

Collapse -

Copy .msg file back into Outlook 2000

by IT_Cowboy In reply to Copy .msg file back into ...

That achieves the result in the folders as I wanted, but I need a solution in VBA preferrably. I should have been more specific in my question. Thanks anyway

Collapse -

Copy .msg file back into Outlook 2000

by DKlippert In reply to Copy .msg file back into ...

The microsoft.public.outlook.general forum had a question about this. Look for a message from Sue Mosher on 8/13/2001. She suggests "You can use the Namespace.CreateItemFromTemplate method to create a new item that's a copy of the .msg file, then save that item to the folder."

Here?s a piece of code a respondent came up with.

Sub CopyTasks()

Set fso = CreateObject("Scripting.FileSystemObject")
Call OutLookOpen 'outlook running?
strpath = "f:\tasktest\"

Set ItemFolder = fso.GetFolder(strpath)
Set oFilesInFolderCollection = ItemFolder.Files
For Each otaskItem In oFilesInFolderCollection
Set TheItem = otaskItem.GetInspector
MsgBox otaskItem.Name
MsgBox otaskItem.Type
Set TheItem = objOutApp.CreateItemFromTemplate(otaskItem)
TheItem.Display 'Does it work????
TheItem.Save
Next
Set fso = Nothing
End Sub

Good luck

Collapse -

Copy .msg file back into Outlook 2000

by DKlippert In reply to Copy .msg file back into ...

Have you found a solution yet?

Collapse -

Copy .msg file back into Outlook 2000

by IT_Cowboy In reply to Copy .msg file back into ...

I ended up finding the method I was looking for but was unable to satisfy myself as to its process.
First you need to open the message in an inspector window, then use the inspector window to assign a mailitem object to it. Once the mail item object is assigned you can move/copy the message into the required outlook folder. Problem is I wanted the process to be trasparent but to open the message you need to use an API ShellExecute call that will not hide the inspector window.

Collapse -

Copy .msg file back into Outlook 2000

by IT_Cowboy In reply to Copy .msg file back into ...

This question was closed by the author

Back to Web Development Forum
6 total posts (Page 1 of 1)  

Related Discussions

Software Forums