User Guide
ActiveDocument Object 239
Reload
Syntax Reload(wbPromptToSave: WordBool);
Description Boolean. Reloads the active document. If wbPromptToSave is True, prompts the user
to save changes.
ReplaceAll
Syntax ReplaceAll(strSearch, strReplace: OleVariant; bMatchCase: WordBool):
Integer;
Description Boolean. Replaces all occurrences of strSearch with strReplace, matching case if
bMatchCase is True. Returns the number of replacements made.
Save
Syntax Save: WordBool();
Description Boolean. Saves changes to the active document. Returns True if successful.
SaveAs
Syntax SaveAs(wsFileName: widestring): WordBool;
Description Boolean. Saves changes to the active document to the file specified in the
wsFileName parameter.Returns True if successful.
If
wsFileName is empty, the standard Save As dialog box displays. This function
overwrites existing files, so use it with caution.
Example
function Main(){
var sFile = ’’;
// Insert a link and create the file in one step
with (Application){
sFile = InputBox(’Add File Link’, ’Enter a filename to create and
link to:’, sFile);
if (sFile == ’’){
return;
}
ActiveDocument.InsertTag(’<a href="’ + sFile + ’">’, ’</a>’,
false);
NewDocument(true);
ActiveDocument.SaveAs(CurrentFolder + ’\\’ + sFile);
}
}