Skip to main content
Skip table of contents

f$Word: Save document (as)


f$Word: Save document (as)

Save a copy of an active document. Calling this function is necessary if Word throws the error: ’Formatting too complex’. Saving a copy can provide a solution for such cases.

This function can also be used to save the active document with different name or file type.

Syntax:

Status = f$Word('Save document','File name','Type')

 

Argument

Type

Meaning

 

Save document

String

Keyword

 

File name

String

Name of the document with file extension and path information. If '' is given as file name, the file name of the function f$Word :Document will be used.

 

Type

String

File type to be used, when saving with a different type:

'' - save in current format

'0' – save as Word document
'1' – save as template
'2' – save as formatted text

'3' – save as formatted text with breaks

4' – save as DOS text

'5' – save as DOS text with line breaks

'6' – save as RTF

'7' – save as Unicode text

'8' – save as HTML
'11' – save as XML
'12' – save as XML document (.docx)
'14' – save as XML template
'17' – save as PDF
'18' – save as XPS
'23' – save as OpenDocument format (.odt)

Result:

Integer

0: Command successfully executed

-1: The document of intent cannot be saved.

Example:

Status = f$Word('Save document','c:\\temp\\offer.rtf,'6')

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.