Оператор LockDocument и функция LockDocument()
Sub MAIN
If SelInfo(27) = - 1 Then FileNew
ViewMasterDocument
Insert "This is a Master document"
InsertPara
FileSaveAs .Name = "C:\MACROMST.DOC", .AddToMru = 1
CreateSubdocument
LineDown 2
LineUp 1
Insert "Это поддокумент 1."
FileSaveAs .Name = "C:\MSSUB1.DOC", .AddToMru = 1
LineDown 2
CreateSubdocument
LineDown 1
Insert "Это поддокумент 2."
FileSaveAs .Name = "C:\MSSUB2.DOC", .AddToMru = 1
LineUp 3
MsgBox "Word will now lock sub document1. Note the padlock on the left."
LockDocument
If LockDocument() = - 1 Then
MsgBox "The File is now locked. Нажмите OK, чтобы возобновит demo."
MsgBox "Теперь Word разблокирует поддокумент 1."
MsgBox "Note the padlock is no longer there."
LockDocument
FileClose 1
Kill "C:\MACROMST.DOC"
Kill "C:\SUB1.DOC"
Kill "C:\SUB2.DOC"
End Sub