ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing file formats while saving (https://www.excelbanter.com/excel-programming/371388-changing-file-formats-while-saving.html)

UBER_GEEK

Changing file formats while saving
 
I would like to be able to save a word doc format into a rtf format
from with in excel programming, ive tried coping the code that word
would do it, into excel, and im getting an error 448. Can anyone help?

Basically im trying to take word docs from emails, and convert them to
smaller files.

..Attachments(1).SaveAsFile Filename:=savename, FileFormat:=wdFormatRTF

savename inclues the file path, and name, and ive done with out the
&".rtf" and with out it.


Dave Peterson

Changing file formats while saving
 
Could it be as simple as changing the wdFormatRTF built in word constant to its
value:

..Attachments(1).SaveAsFile Filename:=savename, FileFormat:=6

If you don't have a reference to MSWord in that workbook's project, then maybe
that's the problem.


UBER_GEEK wrote:

I would like to be able to save a word doc format into a rtf format
from with in excel programming, ive tried coping the code that word
would do it, into excel, and im getting an error 448. Can anyone help?

Basically im trying to take word docs from emails, and convert them to
smaller files.

.Attachments(1).SaveAsFile Filename:=savename, FileFormat:=wdFormatRTF

savename inclues the file path, and name, and ive done with out the
&".rtf" and with out it.


--

Dave Peterson

NickHK

Changing file formats while saving
 
As well as Dave's suggestion, what is the With block this code is on ?

NickHK

"UBER_GEEK" wrote in message
oups.com...
I would like to be able to save a word doc format into a rtf format
from with in excel programming, ive tried coping the code that word
would do it, into excel, and im getting an error 448. Can anyone help?

Basically im trying to take word docs from emails, and convert them to
smaller files.

.Attachments(1).SaveAsFile Filename:=savename, FileFormat:=wdFormatRTF

savename inclues the file path, and name, and ive done with out the
&".rtf" and with out it.





All times are GMT +1. The time now is 01:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com