[status,message]
= docview(filename)
opens and displays the specified file as a Word document. Returns success or failure
and, if appropriate, an error message.
[status,message]
= docview(filename,option1...optionN)
specifies one or more operations to perform in Word. The operations require
Microsoft Word on a Windows platform.
Open a document in RTF format in Word.
This example assumes the document magic-squares.rtf is
on the MATLAB® path.
docview('magic-square.rtf');
Print a Document
Print a document. This example assumes the document mydoc.doc is
on the MATLAB path.
docview('mydoc.doc','printdoc');
Use Several docview Options
Use docview to update TOC fields
in a document, convert the document to PDF, and close a Word document.
This command creates the document mytocdoc.pdf in
the current folder. This example assumes the document mytocdoc.docx is
on the MATLAB path.
filename — Name of file to view, print, or update character vector
Name of file to view, print, or update, specified as the full
path name.
option — Operation to perform in Word 'updatefields' | 'updatedocxfields' | 'convertdocxtopdf' | 'showdocxaspdf' | 'unlinkdocxsubdoc' | 'printdoc' | 'savedoc' | 'closedoc' | 'closeapp'
Operation to perform in Microsoft Word on a Windows platform, specified as one of these values:
'updatefields' — Update fields, such as
the TOC.
'updatedocxfields' — Update fields in a
DOCX document.
'convertdocxtopdf' — Convert a
DOCX document to
PDF.
'showdocxaspdf' — Convert a
DOCX document to PDF and
open in a PDF viewer.
'unlinkdocxsubdoc' — Replace links to
other documents with the content of those documents. To learn about
subdocuments, see mlreportgen.dom.DOCXSubDoc.
'printdoc' — Print the document. The
document must be open In Word before you use this option.