WordBasic -

На нашем портале о Лондонском клубе Челси вы в любое время сможете быть в курсе всех событий |

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