View Single Post
 
Old 04-07-2023, 05:38 AM
fops fops is offline Windows 10 Office 2019
Novice
 
Join Date: Mar 2023
Posts: 6
fops is on a distinguished road
Default

Hi,

then, if i am right in my assumption, i could create a template, a blank template, (never worked with templates ) with one of your codes only and then check for my file.docm if open and then close it.


Additionally i would have in my file.docm:
---------------------------------------------------------------------------------

Sub CloseDoc()
ThisDocument.Close SaveChanges:=wdSaveChanges
End Sub

...

Application.OnTime When:=Now + TimeValue("00:00:30"), Name:="CloseDoc"

...
---------------------------------------------------------------------------------

just for the case the only document open is file.docm.
Is that approx. right?

Greetings
fops
Reply With Quote