UserControl Property Example

This example displays the status of the UserControl property for the active document. This example will only work correctly when run from another Office application with the Word 9.0 object library loaded.

Set wd = New Word.Application
Set wdDoc = _
    wd.Documents.Open("C:\My Documents\doc1.doc")
If wdDoc.UserControl = True Then
    MsgBox "This document was created or opened by the user."
Else
    MsgBox "This document was created programmatically."
End If