Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-27-2014, 11:53 PM
nsv nsv is offline Detect in VBA if document has been changed Windows XP Detect in VBA if document has been changed Office 2003
Novice
Detect in VBA if document has been changed
 
Join Date: Jul 2010
Location: Denmark
Posts: 17
nsv is on a distinguished road
Default Detect in VBA if document has been changed

A Word document functions as a kind of engineering drawing that has to be updated from time to time.
To keep a track on these updates a parallel document serves as a log where the changes are described, and to make sure it is filled in every time changes are made, I have an AutoClose macro in the drawing document automatically open the log document.

I should like to make it so, that the log is opened only if changes have been made to the drawing document, but I do not know how to detect that in VBA.
Anyone has a clue?

NSV
Reply With Quote
  #2  
Old 04-28-2014, 01:18 AM
macropod's Avatar
macropod macropod is offline Detect in VBA if document has been changed Windows 7 32bit Detect in VBA if document has been changed Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Simply use Track Changes in the document. That will record all changes, including who made them an when (unless the user turns Track Changes off).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-28-2014, 05:44 AM
nsv nsv is offline Detect in VBA if document has been changed Windows XP Detect in VBA if document has been changed Office 2003
Novice
Detect in VBA if document has been changed
 
Join Date: Jul 2010
Location: Denmark
Posts: 17
nsv is on a distinguished road
Default Detect in VBA if a document has been changed

I do not want to switch on Track Changes; what I need is VBA access to the same 'flag' that prompts the program when closing down to ask if I want to save changes - if such a 'flag' exists.
I am looking for a 'DocumentChange = True' or something like that.

NSV
Reply With Quote
  #4  
Old 04-28-2014, 05:49 AM
macropod's Avatar
macropod macropod is offline Detect in VBA if document has been changed Windows 7 32bit Detect in VBA if document has been changed Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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 can test the Saved state (e.g. If 'Document.Saved = False') to tell you whether the document has been edited but, unless you're doing some form of before/after comparison, you'll have no way of knowing what those changes were. And, unless you trap all saves as well, testing the Saved state won't even tell you whether the document was changed while it was open.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 04-28-2014, 05:58 AM
nsv nsv is offline Detect in VBA if document has been changed Windows 8 Detect in VBA if document has been changed Office 2013
Novice
Detect in VBA if document has been changed
 
Join Date: Jul 2010
Location: Denmark
Posts: 17
nsv is on a distinguished road
Default

OK, I see.
I was hoping for something that could tell me if changes had been made within the session, regardless of the document having been saved, but I see that it is not possible.
Thanks for your help.

NSV
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Detect in VBA if document has been changed Hours in MS Project Changed ayeh Project 14 02-12-2014 10:41 AM
Detect a cell has un-approved change or not? LongTTH Excel Programming 1 05-20-2012 02:22 AM
auto-detect display options? davidt76 PowerPoint 0 09-30-2011 07:26 AM
Detect in VBA if document has been changed Is there a way to detect duplicate dates as I enter them? Karin Excel 1 03-04-2011 12:56 PM
What slide attribute can I use in VBA to detect hidden slide? mikel401 PowerPoint 1 02-22-2011 11:13 AM

Other Forums: Access Forums

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