A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Trying to Use Redemption to copy msg attachments to inbox



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 9th 09, 07:09 PM posted to microsoft.public.outlook.program_vba
Aaron
external usenet poster
 
Posts: 23
Default Trying to Use Redemption to copy msg attachments to inbox

I am trying to use VBA in Outlook to copy an attached msg file in an email to
a folder and then delete the original email. I am currently working to just
get the attached msg file to move to the proper folder. I have downloaded
and installed Redemption in order to do this as suggested on other boards. I
thought my code was close to what other people have (modified for my use),
but it doesn’t seem to work. Please let me know what I need to change for
this. Thank you.

Public Sub CopyAttachment(myMailItem As Outlook.MailItem)

Dim NS As Outlook.NameSpace
Dim olkFolderset As Outlook.Folders
Dim olkFolder As Outlook.Folder
Dim olkAttachedMSG, olkMailItem, olkNewMailItem As Outlook.MailItem
Dim redAttachment, redMailItem As Object
Dim strID As String

strID = myMailItem.EntryID
Set NS = Outlook.GetNamespace("MAPI")
Set olkFolder = NS.OpenSharedFolder("ITCS (POP)\Inbox")
Set olkMailItem = NS.GetItemFromID(strID)
Set redMailItem = CreateObject("Redemption.SafeMailItem")
redMailItem.item = olkMailItem
Set redAttachment = redMailItem.Attachment
Set olkAttachedMSG = redAttachment.EmbeddedMsg
Set olkNewMailItem = Outlook.CreateItem(olMailItem)
olkAttachedMSG.CopyTo (olkNewMailItem)
olkNewMailItem.Save
olkNewMailItem.Move (olkFolder)

End Sub
Ads
  #2  
Old February 9th 09, 07:11 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Trying to Use Redemption to copy msg attachments to inbox

What exactly does not work?
Do you get an error? Or it simply produces an unexpected result?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Aaron" wrote in message
...
I am trying to use VBA in Outlook to copy an attached msg file in an email
to
a folder and then delete the original email. I am currently working to
just
get the attached msg file to move to the proper folder. I have downloaded
and installed Redemption in order to do this as suggested on other boards.
I
thought my code was close to what other people have (modified for my use),
but it doesn't seem to work. Please let me know what I need to change for
this. Thank you.

Public Sub CopyAttachment(myMailItem As Outlook.MailItem)

Dim NS As Outlook.NameSpace
Dim olkFolderset As Outlook.Folders
Dim olkFolder As Outlook.Folder
Dim olkAttachedMSG, olkMailItem, olkNewMailItem As Outlook.MailItem
Dim redAttachment, redMailItem As Object
Dim strID As String

strID = myMailItem.EntryID
Set NS = Outlook.GetNamespace("MAPI")
Set olkFolder = NS.OpenSharedFolder("ITCS (POP)\Inbox")
Set olkMailItem = NS.GetItemFromID(strID)
Set redMailItem = CreateObject("Redemption.SafeMailItem")
redMailItem.item = olkMailItem
Set redAttachment = redMailItem.Attachment
Set olkAttachedMSG = redAttachment.EmbeddedMsg
Set olkNewMailItem = Outlook.CreateItem(olMailItem)
olkAttachedMSG.CopyTo (olkNewMailItem)
olkNewMailItem.Save
olkNewMailItem.Move (olkFolder)

End Sub



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
copy/cut and/or paste attachments marieh Outlook - Installation 3 October 31st 08 11:04 AM
Copy Inbox Alven Outlook - General Queries 2 July 7th 07 11:23 AM
Redemption Inbox problem + instability mirzoni Outlook and VBA 9 December 8th 06 04:51 PM
Useing Redemption Object to Read an Inbox Damian Add-ins for Outlook 9 June 8th 06 06:57 AM
cannot copy & paste attachments David Grana Outlook - Installation 0 March 22nd 06 06:01 PM


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.