Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

Macro to save as a .doc file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jodi - 10 Oct 2005 19:25 GMT
HI ALL~
I have an HTML document that opens in word.  I am trying to create a macro
to save it as a .doc file.  Here is the code I have so far.  It saves it as
HTML still, but will not save it as a .doc file.  Any ideas?
Sub SaveAsTextFile()
   Dim strDocName As String
   Dim intPos As Integer
Application.DefaultSaveFormat = wdFormatDocument

   'Find position of extension in filename
   strDocName = ActiveDocument.Name
   intPos = InStrRev(strDocName, ".")

     
      'Save file with new extension
      ChangeFileOpenDirectory "C:\DaPassport-AP\ST\"
   ActiveDocument.SaveAs FileName:=strDocName
   ActiveDocument.SaveAs FileFormat:=wdFormatDocument

End Sub
Marc Adams [marcmyword.com] - 10 Oct 2005 19:49 GMT
Try combining the statements...
activedocument.SaveAs FileName:="Marc", FileFormat:=wdFormatDocument

Hope it helps.
Signature

Please visit my new site: www.marcmyword.com. I''d love your input as to how
to make it great.

> HI ALL~
> I have an HTML document that opens in word.  I am trying to create a macro
[quoted text clipped - 16 lines]
>
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.