Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-03-2016, 10:27 PM
macropod's Avatar
macropod macropod is offline Run Code on all files and save files as .docx Windows 7 64bit Run Code on all files and save files as .docx Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,382
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You could simply change:
.Close SaveChanges:=True
to:
Code:
    .SaveAs2 FileName:=strFolder & "\" & Split(strFile, ".")(0) & ".docx", FileFormat:=wdFormatXMLDocument, AddToRecentFiles:=False


.Close SaveChanges:=False
PS: When posting code, please use the code tags, indicated by the # button on the posting menu. Without them, your code loses much of whatever structure it had.

PPS: I can't see the point of:
Code:
If Selection.PageSetup.Orientation = wdOrientPortrait Then
  Selection.PageSetup.Orientation = wdOrientLandscape
Else
  Selection.PageSetup.Orientation = wdOrientPortrait
End If
since a few lines later you have:
.Orientation = wdOrientLandscape
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Code on all files and save files as .docx Run a macro on multiple docx. files Peter Carter Word VBA 27 12-15-2022 04:10 PM
Corrupted .docx files Mayberry Word 0 08-29-2015 03:17 AM
Run Code on all files and save files as .docx Macros now ok in docx files? techwriterrc12 Word VBA 4 05-09-2013 10:47 AM
How to open Docx files? mond_bees Word 12 08-29-2012 03:32 AM
Icon for docx files Jazz43 Word 2 10-20-2009 08:34 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:40 PM.


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