Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-16-2023, 11:01 PM
Dimsok Dimsok is offline Convert to .doc Windows XP Convert to .doc Office 2007
Advanced Beginner
Convert to .doc
 
Join Date: Sep 2014
Location: exUSSR
Posts: 50
Dimsok is on a distinguished road
Default Convert to .doc

I try such code for converting docx to doc format:


Code:
Sub ToDoc()
    Application.Run MacroName:="FileSaveWord11"
End Sub
But there is file dialog for saving it after execution. How to modify it for saving it silently without confirming in file dialog?
Reply With Quote
  #2  
Old 04-17-2023, 07:11 AM
gmayor's Avatar
gmayor gmayor is offline Convert to .doc Windows 10 Convert to .doc Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Without knowing what the macro FileSaveWord11 is it is difficult to comment, however the following will save an existing document as DOC format - however be aware that DOC foirmat is not fully compatible with some later elements of DOCX format.

Code:
Sub SaveAsDOC()
Dim sPath As String
    ActiveDocument.Save
    sPath = Replace(ActiveDocument.FullName, ".docx", ".doc")
    ActiveDocument.SaveAs2 FileName:=sPath, FileFormat:=wdFormatDocument97
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 04-23-2023, 10:18 PM
Dimsok Dimsok is offline Convert to .doc Windows XP Convert to .doc Office 2007
Advanced Beginner
Convert to .doc
 
Join Date: Sep 2014
Location: exUSSR
Posts: 50
Dimsok is on a distinguished road
Default

This code gives error: runtime error 438 Object doesn't support this property of method. Have to use "SaveAs Filename" instead of "SaveAs2 FileName" for working.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert to .doc Macro to convert table to convert table into iCalendar file? Weboh Word VBA 5 12-10-2016 03:07 PM
how to convert .wps to .doc ret_squid Word 1 08-11-2016 09:03 PM
Convert to .doc How to convert 8 1/2 x 11 to A4 GrantSaw Word 3 01-28-2015 11:04 AM
Convert .ost to .pst phoy Outlook 1 12-03-2011 07:07 PM
Convert to .doc Convert PDF to PPT? Hinmini PowerPoint 1 10-28-2011 07:38 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft