File Exchange

image thumbnail

Matlab to MSWord function library

version 1.0.0 (1.77 MB) by fhz
A organized library of functions to write MSWord documents direct from Matlab.

7 Downloads

Updated 16 Feb 2020

View License

Functions are highly based on:
Andreas Karlsson (2019). WriteToWordFromMatlab;
Stefan Braun (2019). ActiveX Word control base commands;
Ivar Eskerud Smith (2020). Control MS Word from matlab.

Many of them are the definition of specialized funtions or improvements on the original ones, specially the functions to create tables and figures.

There is a script as a complete example of all functions and the main options.

Every function has examples

start_Word:
Create a new MSWord file or open an existent.
Enable the visibility of the file. It is faster with visualization.
If it opens an existent file there an option to go to the end of the file.

close_Word:
Close the file and save it. Andreas Karlsson (2019).

write_text:
Write a text with options such as: emphasis, align and color.
Options are given in the comments.

symbol:
For ASCII symbol insertion. Andreas Karlsson (2019).

print_methods:
Prints a list of methods. Andreas Karlsson (2019).

create_table:
The function to create tables inserting data from a cell array.
Its core comes from Andreas Karlsson (2019).
This function adds the options to align the table and the data inside it,
it may remove cell borders and apply the ones you define (not so many option right now, but enough to good results),
and merge columns or rows (but not both at the same time).

page_numbers:
Write the total number of pages on footer or header with a given alignment.

InsertBreak_n:
Insert n page breaks. Ivar Eskerud Smith (2020).

GoTo_Word:
The list of options is given as a comment.
Andreas Karlsson (2019).
Ivar Eskerud Smith (2020).

font_pagesetup:
Prepare Font Name and Size for non-style text inputs.
Prepare the page setup. Stefan Braun (2019).

figure_clipboard_into_word and figure_saved_into_word:
Two techniques to insert figures. Andreas Karlsson (2019).

fc_lib_msword_allfigures_into_Word and fc_lib_msword_allfigures_into_Word_caption:
Update from figure_saved_into_word that inserts all figures of a given list.
It has options to define new labels, to insert captions above or below from the figure and to resize the figure.
The list of figures may be automatically created with the function:
fc_lib_createFile_AllFilesName_ListOfFiles_filter
from my "File Manipulation Library".
(This is necessary because package has different objectives and should not mix).
It still can be manually typed, but will not be as efficient as it could.

create_TOC:
Create the Table of Contents. Andreas Karlsson (2019).

Cite As

fhz (2020). Matlab to MSWord function library (https://www.mathworks.com/matlabcentral/fileexchange/74279-matlab-to-msword-function-library), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux