Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
58 lines (36 sloc) 1.49 KB
title keywords f1_keywords ms.prod api_name ms.assetid ms.date localization_priority
Document.UserControl property (Word)
vbawd10.chm158007388
vbawd10.chm158007388
word
Word.Document.UserControl
34ab71eb-397e-4c14-dfbe-d3f29f84c753
06/08/2017
Normal

Document.UserControl property (Word)

True if the document was created or opened by the user. Read/write Boolean.

Syntax

expression. UserControl

expression A variable that represents a Document object.

Remarks

This property returns False if the document was created or opened programmatically from another Microsoft Office application with the Open method or the Visual Basic CreateObject or GetObject command.

[!NOTE] If Word is visible to the user or if you call the UserControl property from within a Word code module, this property will always return True.

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 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

See also

Document Object

[!includeSupport and feedback]

You can’t perform that action at this time.