mlreportgen.utils.word クラス
名前空間: mlreportgen.utils
Microsoft Word および Word ドキュメントの操作
説明
mlreportgen.utils.word
クラスの静的メソッドを使用して、Microsoft® Word アプリケーションおよび Word ドキュメントを操作します。これらのメソッドは、Microsoft .NET Framework への MATLAB® インターフェイスを使用して Word と通信します。
mlreportgen.utils.word
クラスは handle
クラスです。
メソッド
パブリック メソッド
|
|
|
|
mlreportgen.utils.word.open |
|
mlreportgen.utils.word.close | 次の構文は、Word アプリケーションを閉じます。また、アプリケーションが閉じられる場合は
次の構文は、
|
mlreportgen.utils.word.closeAll | 次の構文は、開いているすべての Word ドキュメントを閉じます。すべての Word ドキュメントが閉じられる場合は
|
mlreportgen.utils.word.show |
|
mlreportgen.utils.word.hide |
|
mlreportgen.utils.word.filenames | files = mlreportgen.utils.word.filenames() は、開いている Word ドキュメントのファイル名を string 配列として返します。 |
mlreportgen.utils.word.isAvailable | tf = mlreportgen.utils.word.isAvailable() は、Word が使用できる場合は true を返し、Word が使用できない場合は false を返します。 |
mlreportgen.utils.word.isStarted | tf = mlreportgen.utils.word.isStarted() は、Word アプリケーションが開始されている場合は true を返し、Word アプリケーションが開始されていない場合は false を返します。 |
mlreportgen.utils.word.isLoaded |
|
mlreportgen.utils.word.wordapp |
|
mlreportgen.utils.word.worddoc |
|
例
Word ドキュメントを開く
Word ファイルの test.docx
と test1.docx
が C:
ドライブの mydocs
という名前のフォルダーにあるとします。mlreportgen.utils.word.open
を使用してファイルを開きます。
wordDoc = mlreportgen.utils.word.open("test") wordDoc1 = mlreportgen.utils.word.open("test1")
wordDoc = WordDoc with properties: FileName: "C:\mydocs\test.docx" wordDoc1 = WordDoc with properties: FileName: "C:\mydocs\test1.docx"
ドキュメント ファイル名の取得
Word ファイル test.docx
および test1.docx
が C:
ドライブの mydocs
という名前のフォルダーにあり、mlreportgen.utils.word.open
を使用してそれらを開いたとします。
mlreportgen.utils.word.filenames
を使用して、開いている Word ドキュメント ファイルのファイル名を取得します。
files = mlreportgen.utils.word.filenames()
files = 1×2 string array "C:\mydocs\test.docx" "C:\mydocs\test1.docx"
バージョン履歴
R2018b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)