View Single Post
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Terry[_3_] Terry[_3_] is offline
external usenet poster
 
Posts: 1
Default detect if word has been edited

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