MATLAB: Are the figures missing from Rich Text Format (RTF) files generated with MATLAB Report Generator when I open the files in Microsoft Word 2003

docfigureimageimagesMATLABofficertf

Using MATLAB Report Generator, I generate Rich Text Format (RTF) files that include figures. When I open the files in Microsoft Word 2003, the figures are missing from the generated report.

Best Answer

RTF files generated by MATLAB Report Generator include figures as externally linked files using field codes. Microsoft Word does not update the field codes automatically when an RTF document is opened. The figures should be visible in the document when you launch Microsoft Word from the Report Viewer. However, when you open RTF files from within Microsoft Word or from Windows, the figures are not visible.
There are several options to make the figures visible.
1. After the file is open in Microsoft Word, select all text by pressing CTRL+A. Then, update the fields by pressing F9.
OR
2. Open the file by typing the following command at the MATLAB Command Prompt:
docview('%<FileName>','UpdateFields');
Replace %<FileName> with the name of your file, which should be located in the current directory.
Once the images are visible, after using either of these methods, you can use the Save As command from the File menu in Microsoft Word to save the RTF document with a different name. Microsoft Word embeds the images in the document, and they are visible every time you open the new file. However, the resulting file is much larger than the separate RTF and image files created by MATLAB.
3. A final option is to create the report in Word document form. Beginning with version 2.3 (R14SP2+), MATLAB Report Generator creates reports in Microsoft Word document format.
Note: If the figures are not visible when you launch Microsoft Word from the Report Viewer, this is probably due to a bug that was fixed in version 2.2.1 (R14SP2). If you are using a previous version, read the following:
In MATLAB Report Generator 2.1.1 (R14SP1), you can work around this issue by modifying the Report Generator preferences in MATLAB. Here are the steps:
1. Open the Preferences dialog box by clicking Preferences on the MATLAB File menu.
2. Click Report Generator in the left pane of the Preferences dialog box.
3. Under Output Format Options, change the Format ID to Rich Text Format.
4. Under Output Format Options, change the View command from
docview(%'<FileName>','-UpdateFields');
to
docview('%<FileName>','UpdateFields');
5. Click OK to save the changes you made and close the Preferences dialog box.