how to convert a ms-word attactment to a file.txt

  • Thread starter Thread starter Gerie Alards
  • Start date Start date
G

Gerie Alards

hi,

I've tried several possibilities (without result) to convert ms-word
attachments
automatically into a text file. The SaveAs method is not available for a
attachment.

hope somebody can help me out.

regards,
gerie alards
 
You'd have to save the attachment to the file system and then somehow
manipulate it from there. For example you could automate Word to open the
saved attachment and then use Word's SaveAs command to save it as a text
file.
 
after SaveAttachments all attachments are recorded in a specified
directory as ms-word documents.
I'm looking to process them from there in the same VBA Outlook session
to open them with some other type of object in order to be able to
use the "SaveAs" method.
 
Yes, that's what I said.

If you save the attachment it's a Word file. You then create a Word
application object, use Word automation to open the document, then use
Word's SaveAs command to save it in the format you want.
 
the following I wrote in Outlook:

.. .
Set word = Application.CreateObject("Word.Application")
word.Visible = True
word.documents.Open ("C:\test.doc")property or method not supported by this object
(translated from dutch!)

The save method is known.

regards,
gerie alards
 
Hello Ken,

finally I got it right!
First I added the "MS word object library" to the VBA environment
and 2nd I defined "Dim doc As word.document" instead of word.application.

doing so the SaveAs is recognized as a available method.

thanks!
 
Back
Top