Package: mlreportgen.utils
Superclasses:
Wrap a Microsoft Word doc file
This utility wraps a Word document file (.docx
or
.rtf
) into an object. You can then manipulate the object using the
methods of this utility.
wraps a Word document file and returns it as a Word doc object. Only one
docobj
= mlreportgen.utils.WordDoc(filename
)WordDoc
object can exist for each Word document file.
show | Make Word document visible
|
hide | Hide Word document
|
close | Close Word document
|
save | Save Word document
|
update | Update Word document fields
|
print | Print Word document
|
saveAsDoc | Save as doc file with same file name
Save as doc file with specified file name
|
exportToPDF | Export to PDF document with same file name
Export to PDF document with specified file name
|
unlinkFields | Remove links from fields in the Word document
See Word FieldType Enumeration for information on Word fields. |
unlinkSubdocuments | Remove links to subdocuments and copy subdocuments into master document
|
isOpen | Test if Word document is open
|
isReadOnly | Test if Word document is read-only
|
isSaved | Test if Word document is saved
|
isVisible | Test if Word document is visible
|
netobj | Return a .NET Word document object, which allows using the .NET interface on this object
|
This example creates a WordDoc object from the existing
MyWordDoc.docx
file.
docobj = mlreportgen.utils.WordDoc("MyWordDoc.docx");
netobj(docobj);