MinotaurWarrior
MinotaurWarrior

Reputation: 11

Using VBA to save an attachment as a different filetype

I'm trying to write a macro to save html attachments as .txt files (and then do some stuff with the .txt file) but am running into a problem right out of the gate - the Attachment object only has the SaveAsFile method, not the SaveAs method, and the SaveAsFile method only has the path parameter, not the type parameter.

I've tried various methods of just sneaking .txt into the pathname, and none have worked.

This is my first attempt at "serious" programming, so it's possible I'm missing something incredibly obvious.

Upvotes: 1

Views: 435

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49395

You just need to specify the desired extension for the file. The SaveAsFile method of the Attachment class saves the attachment to the specified path (with the specified filename).

You may also find the Getting Started with VBA in Outlook 2010 article helpful.

Upvotes: 1

Related Questions