Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dump Outlook Text From One Folder to Word
Message
From
21/01/2005 10:36:37
 
 
To
20/01/2005 15:56:57
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00979029
Message ID:
00979272
Views:
13
>>We've received a bunch of feedback via email. I've moved all messages of interest into a separate Outlook folder. We would like all of the text in a single document. Is there an easy way to dump all of that text into Word?
>>
>>I tried "obvious" solutions like dragging the messages to Word, but Word did not divine my intention.
>>
>
>You could certainly do this with a little automation code. Open Outlook and Word, create a Word doc, dig down to the right folder in Outlook, and loop through the messages. For each message, grab the text (I think the relevant property is Body) and add it to the document.
>
>Let me know if you need to see some actual code.

Thanks, Tamar. I used roughly the following and it worked fine:
* Open Word and create a blank document:
ww = CREATEOBJECT('Word.Application')
doc = ww.Documents.Add()
* Open Outlook and open the source folder:
ol = CREATEOBJECT('Outlook.Application')
ns = ol.GetNamespace([MAPI])
fol = ns.Folders('Client Folders').Folders('Client A').Folders('Meetings').Folders(1)
* Iterate the messages, dumping into Word:
FOR EACH Msg IN Fol.Items
  ww.Selection.InsertAfter(Msg.Body)
ENDFOR
* Check results in Word:
ww.Visible=.t.
-- Randy
Previous
Reply
Map
View

Click here to load this message in the networking platform