![]() |
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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
If an email has a .msg attachment, I need to save it off as an .rtf
attachment. Is there a way to do this? If lngCount 0 Then ' We need to use a count down loop for ' removing items from a collection. Otherwise, ' the loop counter gets confused and only every ' other item is removed. For i = lngCount To 1 Step -1 Dim path As String ' Get the file name. strfile = objAttachments.Item(i).FileName 'Check filename of attachment to see if .msg If Right(strfile, 3) = "msg" Then strfile = Replace(strfile, " ", "_") strfile = strfile & ".rtf" path = fso.BuildPath(tempdir, strfile) objAttachments.Item.SaveAsFile path, olRTF ExecCmd "ttimport.exe " & app & " " & strfile Else strfile = Replace(strfile, " ", "_") 'Combine with the path to the Temp folder. strfile = tempdir & strfile ' Save the attachment as a file. objAttachments.Item(i).SaveAsFile strfile ExecCmd "ttimport.exe " & app & " " & strfile End If Next i End If Thanks!! |
Ads |
#2
|
|||
|
|||
![]() As far as I know Outlook can save only rtf formatted messages as rtf files. -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Wed, 18 Nov 2009 09:31:03 -0800 schrieb hlock: If an email has a .msg attachment, I need to save it off as an .rtf attachment. Is there a way to do this? If lngCount 0 Then ' We need to use a count down loop for ' removing items from a collection. Otherwise, ' the loop counter gets confused and only every ' other item is removed. For i = lngCount To 1 Step -1 Dim path As String ' Get the file name. strfile = objAttachments.Item(i).FileName 'Check filename of attachment to see if .msg If Right(strfile, 3) = "msg" Then strfile = Replace(strfile, " ", "_") strfile = strfile & ".rtf" path = fso.BuildPath(tempdir, strfile) objAttachments.Item.SaveAsFile path, olRTF ExecCmd "ttimport.exe " & app & " " & strfile Else strfile = Replace(strfile, " ", "_") 'Combine with the path to the Temp folder. strfile = tempdir & strfile ' Save the attachment as a file. objAttachments.Item(i).SaveAsFile strfile ExecCmd "ttimport.exe " & app & " " & strfile End If Next i End If Thanks!! |
#3
|
|||
|
|||
![]()
What about fooling it? Can we copy all of the aspects of the .msg (To, From,
CC, Subject, Body, etc) and create and .rtf. We are trying to avoid importing .msg files into our document respository system since who knows what email system we may be on later down the road. Any thoughts... If this might work, how would I go about doing this? "Michael Bauer [MVP - Outlook]" wrote: As far as I know Outlook can save only rtf formatted messages as rtf files. -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Wed, 18 Nov 2009 09:31:03 -0800 schrieb hlock: If an email has a .msg attachment, I need to save it off as an .rtf attachment. Is there a way to do this? If lngCount 0 Then ' We need to use a count down loop for ' removing items from a collection. Otherwise, ' the loop counter gets confused and only every ' other item is removed. For i = lngCount To 1 Step -1 Dim path As String ' Get the file name. strfile = objAttachments.Item(i).FileName 'Check filename of attachment to see if .msg If Right(strfile, 3) = "msg" Then strfile = Replace(strfile, " ", "_") strfile = strfile & ".rtf" path = fso.BuildPath(tempdir, strfile) objAttachments.Item.SaveAsFile path, olRTF ExecCmd "ttimport.exe " & app & " " & strfile Else strfile = Replace(strfile, " ", "_") 'Combine with the path to the Temp folder. strfile = tempdir & strfile ' Save the attachment as a file. objAttachments.Item(i).SaveAsFile strfile ExecCmd "ttimport.exe " & app & " " & strfile End If Next i End If Thanks!! . |
#4
|
|||
|
|||
![]()
Do you really mean embedded message attachments or regular attachments with
an .MSG extension? -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "hlock" wrote in message ... If an email has a .msg attachment, I need to save it off as an .rtf attachment. Is there a way to do this? If lngCount 0 Then ' We need to use a count down loop for ' removing items from a collection. Otherwise, ' the loop counter gets confused and only every ' other item is removed. For i = lngCount To 1 Step -1 Dim path As String ' Get the file name. strfile = objAttachments.Item(i).FileName 'Check filename of attachment to see if .msg If Right(strfile, 3) = "msg" Then strfile = Replace(strfile, " ", "_") strfile = strfile & ".rtf" path = fso.BuildPath(tempdir, strfile) objAttachments.Item.SaveAsFile path, olRTF ExecCmd "ttimport.exe " & app & " " & strfile Else strfile = Replace(strfile, " ", "_") 'Combine with the path to the Temp folder. strfile = tempdir & strfile ' Save the attachment as a file. objAttachments.Item(i).SaveAsFile strfile ExecCmd "ttimport.exe " & app & " " & strfile End If Next i End If Thanks!! |
#5
|
|||
|
|||
![]()
It's a regular attachment.
"Dmitry Streblechenko" wrote: Do you really mean embedded message attachments or regular attachments with an .MSG extension? -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "hlock" wrote in message ... If an email has a .msg attachment, I need to save it off as an .rtf attachment. Is there a way to do this? If lngCount 0 Then ' We need to use a count down loop for ' removing items from a collection. Otherwise, ' the loop counter gets confused and only every ' other item is removed. For i = lngCount To 1 Step -1 Dim path As String ' Get the file name. strfile = objAttachments.Item(i).FileName 'Check filename of attachment to see if .msg If Right(strfile, 3) = "msg" Then strfile = Replace(strfile, " ", "_") strfile = strfile & ".rtf" path = fso.BuildPath(tempdir, strfile) objAttachments.Item.SaveAsFile path, olRTF ExecCmd "ttimport.exe " & app & " " & strfile Else strfile = Replace(strfile, " ", "_") 'Combine with the path to the Temp folder. strfile = tempdir & strfile ' Save the attachment as a file. objAttachments.Item(i).SaveAsFile strfile ExecCmd "ttimport.exe " & app & " " & strfile End If Next i End If Thanks!! . |
#6
|
|||
|
|||
![]()
You can try to save the attachment as an MSG file and then import it back
using Application.CreateItemFromTemplate, butt that will wipe out teh sender and recipeint related properties. plug You can use Redemption to open the MSG file directly using RDOSession.GetMessageFromMsgFile, and then call RDOMail.SaveAs ..., olRtf /plug -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "hlock" wrote in message ... It's a regular attachment. "Dmitry Streblechenko" wrote: Do you really mean embedded message attachments or regular attachments with an .MSG extension? -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "hlock" wrote in message ... If an email has a .msg attachment, I need to save it off as an .rtf attachment. Is there a way to do this? If lngCount 0 Then ' We need to use a count down loop for ' removing items from a collection. Otherwise, ' the loop counter gets confused and only every ' other item is removed. For i = lngCount To 1 Step -1 Dim path As String ' Get the file name. strfile = objAttachments.Item(i).FileName 'Check filename of attachment to see if .msg If Right(strfile, 3) = "msg" Then strfile = Replace(strfile, " ", "_") strfile = strfile & ".rtf" path = fso.BuildPath(tempdir, strfile) objAttachments.Item.SaveAsFile path, olRTF ExecCmd "ttimport.exe " & app & " " & strfile Else strfile = Replace(strfile, " ", "_") 'Combine with the path to the Temp folder. strfile = tempdir & strfile ' Save the attachment as a file. objAttachments.Item(i).SaveAsFile strfile ExecCmd "ttimport.exe " & app & " " & strfile End If Next i End If Thanks!! . |
#7
|
|||
|
|||
![]() RDOSession.GetMessageFromMsgFile, and then call RDOMail.SaveAs ..., olRtf Would that preserve formattings of an html message? -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Wed, 18 Nov 2009 16:32:19 -0700 schrieb Dmitry Streblechenko: You can try to save the attachment as an MSG file and then import it back using Application.CreateItemFromTemplate, butt that will wipe out teh sender and recipeint related properties. plug You can use Redemption to open the MSG file directly using RDOSession.GetMessageFromMsgFile, and then call RDOMail.SaveAs ..., olRtf /plug |
#8
|
|||
|
|||
![]()
That depends on whether the HTML is stored as RTF wrapped HTML in
PR_RTF_COMPRESSED. -- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Michael Bauer [MVP - Outlook]" wrote in message . .. RDOSession.GetMessageFromMsgFile, and then call RDOMail.SaveAs ..., olRtf Would that preserve formattings of an html message? -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Wed, 18 Nov 2009 16:32:19 -0700 schrieb Dmitry Streblechenko: You can try to save the attachment as an MSG file and then import it back using Application.CreateItemFromTemplate, butt that will wipe out teh sender and recipeint related properties. plug You can use Redemption to open the MSG file directly using RDOSession.GetMessageFromMsgFile, and then call RDOMail.SaveAs ..., olRtf /plug |
#9
|
|||
|
|||
![]() Is there any way a user can control that? -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Thu, 19 Nov 2009 09:48:09 -0700 schrieb Dmitry Streblechenko: That depends on whether the HTML is stored as RTF wrapped HTML in PR_RTF_COMPRESSED. |
#10
|
|||
|
|||
![]()
Nope. It is what the message stores.
-- Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool - "Michael Bauer [MVP - Outlook]" wrote in message ... Is there any way a user can control that? -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Thu, 19 Nov 2009 09:48:09 -0700 schrieb Dmitry Streblechenko: That depends on whether the HTML is stored as RTF wrapped HTML in PR_RTF_COMPRESSED. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to save attachment? | jayC[_2_] | Outlook - General Queries | 2 | April 22nd 08 02:06 PM |
attachment save | godadj | Outlook and VBA | 0 | February 11th 08 04:41 PM |
Save Attachment via VBA | Roger Converse | Outlook and VBA | 5 | January 14th 08 05:16 PM |
Can't Save Attachment | Pavan | Outlook - Using Forms | 1 | August 14th 07 02:36 PM |
OE6 don't save modifcation on attachment | Sorin TENE | Outlook Express | 7 | April 6th 06 09:27 AM |