User Guide

243
is this document modified?
if app.DocumentCache(idx).Modified then sTable = sTable + "Yes"
sTable = sTable + "</td><td>"
is this document read-only?
if app.DocumentCache(idx).ReadOnly then sTable = sTable + "Yes"
close row
sTable = sTable + "</td></tr>" + newline
next
sTable = sTable + newline + "</table>"
add a new document (False = dont create from default template -
blank)
app.NewDocument(False)
insert the table (note that the ActiveDocument will be the new
document
created above)
app.ActiveDocument.InsertText sTable, False
switch to browse mode
app.CurrentView = 2
wait for user to re-enter edit mode
while app.CurrentView <> 1
Wait is a home-grown routine to make up for the loss of
DoEvents in VBScript. it will pause for a given number of
milliseconds without locking the interface
app.Wait(100)
wend
return to the original document
app.DocumentIndex = nCurrentIdx
MsgBox "Script Completed."
free the references
set app = nothing
End Sub
function example
function GetDisplayName(fname)
if fname = "" then
GetDisplayName = "(untitled)"
else
GetDisplayName = fname
end if
end function
</pre>
</body>
</html>