PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
How can I create an archive od outlook msgs saved as rtf files (outside of outlook)
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
How can I create an archive od outlook msgs saved as rtf files (outside of outlook)
![]() |
How can I create an archive od outlook msgs saved as rtf files (outside of outlook) |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
How can I create an archive that contains each outlook mshg from the inbox
saved as an rtf file in a folder such as "C:\Messages"? I'm using Outlook 2003. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Set App = CreateObject("Outlook.Application")
Set NS = App.Logon set Inbox = NS.GetDefaulFolder(6) 'olFolderInbox for each Msg in Inbox.Items FileNname = "C:\Messages\" & Msg.Subject 'todo: make sure there are no invalid characters in FileName, such as ":", "*", etc Msg.SaveAs FileName, 1 'olRtf next Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Maxx" <Maxx@Leggs.com> wrote in message news:eQs$87yNIHA.4808@TK2MSFTNGP05.phx.gbl... > How can I create an archive that contains each outlook mshg from the inbox > saved as an rtf file in a folder such as "C:\Messages"? > > I'm using Outlook 2003. > > > > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
I don't understand what NS means?
"Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message news:eRzjZ91NIHA.3852@TK2MSFTNGP06.phx.gbl... > Set App = CreateObject("Outlook.Application") > Set NS = App.Logon > set Inbox = NS.GetDefaulFolder(6) 'olFolderInbox > for each Msg in Inbox.Items > FileNname = "C:\Messages\" & Msg.Subject > 'todo: make sure there are no invalid characters in FileName, such as > ":", "*", etc > Msg.SaveAs FileName, 1 'olRtf > next > > Dmitry Streblechenko (MVP) > http://www.dimastr.com/ > OutlookSpy - Outlook, CDO > and MAPI Developer Tool > > "Maxx" <Maxx@Leggs.com> wrote in message > news:eQs$87yNIHA.4808@TK2MSFTNGP05.phx.gbl... >> How can I create an archive that contains each outlook mshg from the >> inbox saved as an rtf file in a folder such as "C:\Messages"? >> >> I'm using Outlook 2003. >> >> >> >> >> > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Oh, I just realised NS = namespace.
I just want to run a vba routyine from inside outlook 2003 (or excel or word). I don't have visual studio or anything. Max "Maxx" <Maxx@Leggs.com> wrote in message news:O1Msq28OIHA.4136@TK2MSFTNGP03.phx.gbl... >I don't understand what NS means? > > > > "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message > news:eRzjZ91NIHA.3852@TK2MSFTNGP06.phx.gbl... >> Set App = CreateObject("Outlook.Application") >> Set NS = App.Logon >> set Inbox = NS.GetDefaulFolder(6) 'olFolderInbox >> for each Msg in Inbox.Items >> FileNname = "C:\Messages\" & Msg.Subject >> 'todo: make sure there are no invalid characters in FileName, such as >> ":", "*", etc >> Msg.SaveAs FileName, 1 'olRtf >> next >> >> Dmitry Streblechenko (MVP) >> http://www.dimastr.com/ >> OutlookSpy - Outlook, CDO >> and MAPI Developer Tool >> >> "Maxx" <Maxx@Leggs.com> wrote in message >> news:eQs$87yNIHA.4808@TK2MSFTNGP05.phx.gbl... >>> How can I create an archive that contains each outlook mshg from the >>> inbox saved as an rtf file in a folder such as "C:\Messages"? >>> >>> I'm using Outlook 2003. >>> >>> >>> >>> >>> >> >> > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
In that case, in your VBA macro, replace Dmitry's first two statements with this one:
Set NS = Application.Session -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Maxx" <Maxx@Leggs.com> wrote in message news:O3toiH9OIHA.3532@TK2MSFTNGP04.phx.gbl... > Oh, I just realised NS = namespace. > > I just want to run a vba routyine from inside outlook 2003 (or excel or > word). I don't have visual studio or anything. > > Max > > > "Maxx" <Maxx@Leggs.com> wrote in message > news:O1Msq28OIHA.4136@TK2MSFTNGP03.phx.gbl... >>I don't understand what NS means? >> >> >> >> "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message >> news:eRzjZ91NIHA.3852@TK2MSFTNGP06.phx.gbl... >>> Set App = CreateObject("Outlook.Application") >>> Set NS = App.Logon >>> set Inbox = NS.GetDefaulFolder(6) 'olFolderInbox >>> for each Msg in Inbox.Items >>> FileNname = "C:\Messages\" & Msg.Subject >>> 'todo: make sure there are no invalid characters in FileName, such as >>> ":", "*", etc >>> Msg.SaveAs FileName, 1 'olRtf >>> next >>> >>> Dmitry Streblechenko (MVP) >>> http://www.dimastr.com/ >>> OutlookSpy - Outlook, CDO >>> and MAPI Developer Tool >>> >>> "Maxx" <Maxx@Leggs.com> wrote in message >>> news:eQs$87yNIHA.4808@TK2MSFTNGP05.phx.gbl... >>>> How can I create an archive that contains each outlook mshg from the >>>> inbox saved as an rtf file in a folder such as "C:\Messages"? >>>> >>>> I'm using Outlook 2003. >>>> >>>> >>>> >>>> >>>> >>> >>> >> >> > > |
|
|
|
#6 |
|
Guest
Posts: n/a
|
Ah, sorry, replace the line
Set NS = App.Logon with Set NS = \App.GetNamespace("MAPI") NS.Logon Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Maxx" <Maxx@Leggs.com> wrote in message news:O1Msq28OIHA.4136@TK2MSFTNGP03.phx.gbl... >I don't understand what NS means? > > > > "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message > news:eRzjZ91NIHA.3852@TK2MSFTNGP06.phx.gbl... >> Set App = CreateObject("Outlook.Application") >> Set NS = App.Logon >> set Inbox = NS.GetDefaulFolder(6) 'olFolderInbox >> for each Msg in Inbox.Items >> FileNname = "C:\Messages\" & Msg.Subject >> 'todo: make sure there are no invalid characters in FileName, such as >> ":", "*", etc >> Msg.SaveAs FileName, 1 'olRtf >> next >> >> Dmitry Streblechenko (MVP) >> http://www.dimastr.com/ >> OutlookSpy - Outlook, CDO >> and MAPI Developer Tool >> >> "Maxx" <Maxx@Leggs.com> wrote in message >> news:eQs$87yNIHA.4808@TK2MSFTNGP05.phx.gbl... >>> How can I create an archive that contains each outlook mshg from the >>> inbox saved as an rtf file in a folder such as "C:\Messages"? >>> >>> I'm using Outlook 2003. >>> >>> >>> >>> >>> >> >> > > |
|
|
|
#7 |
|
Guest
Posts: n/a
|
Hi, What should I do to save the mails in .msg format? *** Sent via Developersdex http://www.developersdex.com *** |
|
|
|
#8 |
|
Guest
Posts: n/a
|
Call SaveAs specifying the olMsg rather than olRtf format.
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Sudharsan Chandra" <sudharsan@ingvysyabank.com> wrote in message news:uGFxH3UPIHA.4136@TK2MSFTNGP03.phx.gbl... > > Hi, > What should I do to save the mails in .msg format? > > > *** Sent via Developersdex http://www.developersdex.com *** |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

