Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attempting to use Powershell to import .msg files from folder

Status
Not open for further replies.

kernelpatch

Technical User
Mar 22, 2010
1
CA
Hello Folks,

I'm using powershell in conjuction with the Outlook Redemption library in an attempt to import messages already present in a folder on the desktop. Although, the code gives no errors, I just don't see the end result of the message being in the inbox. The code being used is as follows:

-----------------------------------------------
$outlook = New-Object -COM Outlook.Application
$routlook = New-Object -COM Redemption.RDOSession
$routlook.Logon
$routlook.MAPIOBJECT = $outlook.Session.MAPIOBJECT
$msg = $routlook.GetDefaultFolder(6).Items.Add(0)
$msg.Import("c:\test.msg", 1024)
$msg.save
$routlook.Logoff

-------------------------------------------------

Any help will be appreciated.

Thanks.

Kernel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top