What is it saving as?

D

DaddyUnit

Application.Documents.Open
"http://www.gsa.gov/graphics/staffoffices/GSACFO_5yr_Plan_FY03_07.doc"
ActiveDocument.SaveAs "C:\Users\Unhappy Microsoft
Customer\Documents" & ActiveDocument.Name, wdFormatDocument

When I go back and browse the "Documents" folder I see my file but it is
listed as a "DOC File" instead of a "Microsoft Office Word Document" and if I
double-click on it it opens in notepad and is infected with billions of
unhelpful random characters.

If, while I'm running my code, I stop execution immediately before the last
line, switch to the Active Document and manually save the document, it saves
just fine.

How can I programmatically save a word document so that it is later
recognized as a word document?
 
D

Doug Robbins - Word MVP

If you wanted to save it in "C:\Users\Unhappy Microsoft Customer\Documents",
you should use

"C:\Users\Unhappy Microsoft Customer\Documents\"

otherwise it gets saved in

"C:\Users\Unhappy Microsoft Customer\"

as

DocumentsGSAFCO_5yr_Plan_FY03_07.doc

In my test using your code, modified only by the replacement of "Unhappy
Microsoft Customer" with the username of "Doug", it was saved as with the
Type: Microsoft Office Word 97-2003 Document, with a Size of 5.84 MB, Date
Modified: 2/08/2009 7.01 AM and Pages: 27

Double clicking on it in Windows Explorer opens it in Word.

If it has a .doc extension and it is opening in Notepad, is that also what
happens when you click on other documents that have a .doc extension?

Maybe it's a conspiracy against unhappy Microsoft customers.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top