A
Armin Laschet
Hi all,
for three weeks I'm working with VBA in W2K/Office2000.
I created a document in Word with fields (links) and use the two
procedures:
Private Sub Document_Open()
Dim fld As Field
' Here I will have a routine to check
' whether a fields update is necessary
For Each fld In ActiveDocument.Fields
If fld.Type = wdFieldLink Then
fld.Update
End If
Next fld
ActiveDocument.Saved = True
End Sub
Private Sub Document_Close()
Debug.Print ActiveDocument.Saved ' = 'False'
End Sub
So I update the fields "manually" and set the 'Saved' property to
'True', in order to have the Save Changes Dialog on closing only if
(further) changes have been made to the document. To my surprise, the
dialog is shown every time I close the document, as the 'Saved'
property is always set to 'False'.
Does anyone know why that's so? Is there any other way to check whether
changes have been made after the fields update?
Armin
for three weeks I'm working with VBA in W2K/Office2000.
I created a document in Word with fields (links) and use the two
procedures:
Private Sub Document_Open()
Dim fld As Field
' Here I will have a routine to check
' whether a fields update is necessary
For Each fld In ActiveDocument.Fields
If fld.Type = wdFieldLink Then
fld.Update
End If
Next fld
ActiveDocument.Saved = True
End Sub
Private Sub Document_Close()
Debug.Print ActiveDocument.Saved ' = 'False'
End Sub
So I update the fields "manually" and set the 'Saved' property to
'True', in order to have the Save Changes Dialog on closing only if
(further) changes have been made to the document. To my surprise, the
dialog is shown every time I close the document, as the 'Saved'
property is always set to 'False'.
Does anyone know why that's so? Is there any other way to check whether
changes have been made after the fields update?
Armin