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)

Reply

How can I create an archive od outlook msgs saved as rtf files (outside of outlook)

 
Thread Tools Rate Thread
Old 05-12-2007, 11:07 AM   #1
Maxx
Guest
 
Posts: n/a
Default How can I create an archive od outlook msgs saved as rtf files (outside of outlook)


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.





  Reply With Quote
Old 05-12-2007, 05:55 PM   #2
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: How can I create an archive od outlook msgs saved as rtf files (outside of outlook)

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.
>
>
>
>
>



  Reply With Quote
Old 11-12-2007, 08:13 AM   #3
Maxx
Guest
 
Posts: n/a
Default Re: How can I create an archive od outlook msgs saved as rtf files (outside of outlook)

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.
>>
>>
>>
>>
>>

>
>



  Reply With Quote
Old 11-12-2007, 08:43 AM   #4
Maxx
Guest
 
Posts: n/a
Default Re: How can I create an archive od outlook msgs saved as rtf files (outside of outlook)

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.
>>>
>>>
>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Old 11-12-2007, 03:48 PM   #5
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: How can I create an archive od outlook msgs saved as rtf files (outside of outlook)

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.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>

  Reply With Quote
Old 11-12-2007, 04:57 PM   #6
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: How can I create an archive od outlook msgs saved as rtf files (outside of outlook)

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.
>>>
>>>
>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Old 13-12-2007, 06:02 AM   #7
Sudharsan Chandra
Guest
 
Posts: n/a
Default Re: How can I create an archive od outlook msgs saved as rtf files (outside of outlook)


Hi,
What should I do to save the mails in .msg format?


*** Sent via Developersdex http://www.developersdex.com ***
  Reply With Quote
Old 13-12-2007, 06:02 PM   #8
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: How can I create an archive od outlook msgs saved as rtf files (outside of outlook)

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 ***



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

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