Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 04-07-2023, 05:38 AM
fops fops is offline Close inactive document Windows 10 Close inactive document Office 2019
Novice
Close inactive document
 
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
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to dectect if close document and now no document open skarden Word VBA 2 10-24-2022 07:03 AM
Close inactive document Close Document Without Saving Prompt Joe528 Word 3 10-08-2021 06:12 PM
Document close if/then/else error eduzs Word VBA 1 01-02-2021 05:56 AM
Save and Close powerpoint if it is inactive MetteGaga PowerPoint 0 04-16-2015 05:14 AM
Prompt when close the document ubns Word 15 04-29-2012 10:07 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:45 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