detect if word has been edited

T

Terry

Hi,

I am opening word via VB (code below) and need to know if the user has made
any edits to the doc.
I know I can use wordbasic.isdocumentdirty() in a VBA as below,

Private Sub Document_Close()
If WordBasic.IsDocumentDirty() Then
MsgBox "Doc is dirty"
Else
MsgBox "Doc is not dirty"
End If
End Sub

But I do not want to use a VBA module within the Word doc if I can avoid it.

Is there a way for the calling VB exe to determine IsDocumentDirty() ?
VB code follows:

Dim objApp As New Word.Application
Dim objDoc As Word.Document

objApp.Documents.Open FileName:="C:\temp\test.doc",
AddToRecentFiles:=False

objApp.Visible = True
objApp.Activate
Set objDoc = objApp.ActiveDocument


MsgBox "Click to continue"
objDoc.Close
 
J

Jay Freedman

You got two answers to your identical question in the vba.general
newsgroup. Please don't post the same question in more than one group
-- we all read (mostly) the same groups, so it wastes everyone's time.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top