open method

open(file_name)

Allows a COM application to load a Document from a file.

def open(self, file_name: str):
    ...
ParameterTypeDescription
file_namestrFilename of the document to load.

Remarks

This method is same as calling the Document constructor with a file name parameter.

Returns

A Document object that represents a Word document.

open(stream)

Allows a COM application to load Document from a stream.

def open(self, stream: io.BytesIO):
    ...
ParameterTypeDescription
streamio.BytesIOA .NET stream object that contains the document to load.

Remarks

This method is same as calling the Document constructor with a stream parameter.

Returns

A Document object that represents a Word document.

See Also