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

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



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 5th 07, 12:07 PM posted to microsoft.public.outlook.program_vba
Maxx[_2_]
external usenet poster
 
Posts: 9
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.





Ads
  #2  
Old December 5th 07, 06:55 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default 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" wrote in message
...
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  
Old December 11th 07, 09:13 AM posted to microsoft.public.outlook.program_vba
Maxx[_2_]
external usenet poster
 
Posts: 9
Default 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" wrote in message
...
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" wrote in message
...
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  
Old December 11th 07, 09:43 AM posted to microsoft.public.outlook.program_vba
Maxx[_2_]
external usenet poster
 
Posts: 9
Default 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" wrote in message
...
I don't understand what NS means?



"Dmitry Streblechenko" wrote in message
...
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" wrote in message
...
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  
Old December 11th 07, 04:48 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default 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" wrote in message ...
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" wrote in message
...
I don't understand what NS means?



"Dmitry Streblechenko" wrote in message
...
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" wrote in message
...
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  
Old December 11th 07, 05:57 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default 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" wrote in message
...
I don't understand what NS means?



"Dmitry Streblechenko" wrote in message
...
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" wrote in message
...
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  
Old December 13th 07, 07:02 AM posted to microsoft.public.outlook.program_vba
Sudharsan Chandra
external usenet poster
 
Posts: 1
Default 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 ***
  #8  
Old December 13th 07, 07:02 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default 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" wrote in message
...

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


*** Sent via Developersdex http://www.developersdex.com ***



 




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
Computer crash but msgs saved on zip disk.. now what?? Bonk Outlook Express 11 November 30th 07 05:13 PM
Why does outlook 2007 create archive2.pst and how do I get it to only use archive.pst Jim[_3_] Outlook - General Queries 2 September 13th 07 04:18 PM
Archive Files & Reducing Outlook bloat Sitara Lal Outlook - General Queries 4 July 3rd 07 02:37 PM
How to transfer outlook email msgs. from archive to DVD dcornett Outlook - General Queries 4 May 21st 07 02:38 AM
Outlook Archive location and PRF files CTXFRMR Outlook - Installation 3 January 19th 06 12:51 AM


All times are GMT +1. The time now is 07:10 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.