Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-15-2017, 09:37 AM
twkralnc twkralnc is offline Winword does not close as macro edits multiple files Windows 10 Winword does not close as macro edits multiple files Office 2016
Novice
Winword does not close as macro edits multiple files
 
Join Date: Dec 2017
Posts: 1
twkralnc is on a distinguished road
Thumbs up Winword does not close as macro edits multiple files

FIXED: Application.Quit SaveChanges:=wdSaveChanges




I recorded a macro that edits an existing header and then does a save and close on the file. Works fine for single use.

When I try to run the macro against all the files in a directory, Word does not close between file edits. A blank document is presented and I have to close word to let the cmd file step to the next file.

cmd file...

for /r %%A in (*.docx) do call "C:\Program Files\Microsoft Office\root\Office16\winword.exe" /q "%%A" /mRefHeader

T han K s

Last edited by twkralnc; 12-15-2017 at 12:06 PM. Reason: solved
Reply With Quote
Reply

Tags
macro in word

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Winword does not close as macro edits multiple files Run a macro on multiple docx. files Peter Carter Word VBA 27 12-15-2022 04:10 PM
Macro for multiple RTF files papapaleo Word VBA 1 07-28-2017 04:56 AM
Macro Winword mailmerge split printpage with mergefield as filename pca Word VBA 2 02-28-2014 02:43 PM
Winword does not close as macro edits multiple files looking for macro for multiple files bolk Word 3 05-03-2011 05:46 AM
Winword does not close as macro edits multiple files macro to pull data from multiple files psrs0810 Excel 2 10-25-2010 01:49 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:25 AM.


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