You might not receive an email informing you that there is a new reply in a thread you are following. We are working on fixing this as fast as possible. Please make sure to periodically check the conversation to see if there are any updates.
October 31, 2024
Please note, the notification system in the Community is partially broken
You might not receive an email informing you that there is a new reply in a thread you are following. We are working on fixing this as fast as possible. Please make sure to periodically check the conversation to see if there are any updates.
October 14, 2024
Word Top Contributors:
Automatically close idle document using
Report abuse
Thank you.
Reported content has been submitted
Const interval As Double = 5 ' minutes
Dim selStart As Long
Dim selEnd As Long
Sub AutoOpen()
selStart = 0
selEnd = 0
Application.OnTime When:=DateAdd("n", interval, Now), Name:="CheckStatus", Tolerance:=120
End Sub
Sub CheckStatus()
If Selection.Start <> selStart Or Selection.End <> selEnd Then
selStart = Selection.Start
selEnd = Selection.End
Application.OnTime When:=DateAdd("n", interval, Now), Name:="CheckStatus", Tolerance:=120
Else
ThisDocument.Close SaveChanges:=wdSaveChanges
End If
End Sub
When the document is first opened, it starts a timer. After 5 minutes (or whatever number of minutes you assign to the constant named 'interval'), the CheckStatus macro will run. At that time, if the selection has changed since the document was opened (or since the previous time the CheckStatus macro ran), the selection's location is updated and the timer is restarted. If the selection is still in the same place, the document will be saved and closed without notice.
In practice, there could be a couple of 'unintended consequences'. One is that this code doesn't care whether the selection has moved away from its previous location and then back to the same spot (most likely the beginning of the document, start = 0 and end = 0), so it could close the document prematurely. Another is that the same careless person might notice immediately that the document has disappeared, and reopen it before anyone else gets a chance. I don't think much can be done about either of these possibilities.
If you can replace Word 2007 with Word 2013, it allows simultaneous editing of a document by multiple people. Each user's edits lock only the paragraph(s) that they're editing, and those locks are released when that user saves (and everyone else is notified to refresh).
https://jay-freedman.info
Report abuse
Thank you.
Reported content has been submitted
3 people found this reply helpful
·Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
- If you save a macro-containing document as a .docx, first you get a message telling you that the macros will be discarded, and offering a Cancel button.
- If you save it as a .docm in an untrusted location, the macros will be there but will be disabled, and one of several types of messages will tell you so.
- If your macro security options are set to disable unsigned macros, again you'll get a message (or, at the High setting, they'll just fail to run), but the macros will be visible in the editor.
Along the lines of "is it plugged in?", I have to ask whether you're certain that the file you opened is in the same location as the one you saved. Try again, and check the time stamp on the file.
The only other thing I can think of, though I've never seen it, is if your network at work has some really aggressive antivirus software that watches for macros and strips them out. Are you saving the file to your local drive, or to a network drive or SharePoint
server?
https://jay-freedman.info
Report abuse
Thank you.
Reported content has been submitted
Was this reply helpful?
Sorry this didn't help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
How satisfied are you with this reply?
Thanks for your feedback.
Question Info
Last updated October 1, 2024 Views 5,467 Applies to: