Rank: 280303 based on 0 downloads (last 30 days) and 0 file submitted
photo

Gregory

E-mail

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Gregory View all
Updated File Comments Rating
12 Nov 2013 Control MS Word from matlab A set of functions that can control word from matlab by activex. Author: Ivar Eskerud Smith

Thank you very much for this tool!

Some comments from my side:
1. Function scaleAllImages, line 163-164:
There is no need in specifying both ScaleHeight and ScaleWidth. Indeed, the aspect ratio should be hold, so I replaced these lines with

set(shapes.Item(i),'LockAspectRatio','MsoTrue');
set(shapes.Item(i),'ScaleHeight',factor);

2. If somebody wants to insert Matlab figs into the MS word documents as is (as they are presented at the screen), the following code should be helpful, I think:

%additional arguments specified to avoid opening the figure that is already opened
fig = openfig(file,'reuse','invisible');
%to set the figure size in the word document to be the same as on the screen
set(gcf,'PaperPositionMode','auto');
%copy figure to clipboard as windows EMF
print(fig,'-dmeta');
actxWord.Application.Selection.Paste();
close(fig);

I've placed this code to the insertPicture function instead of the line 413:
actxWord.Application.Selection.InlineShapes.AddPicture( file, link, savewithdoc );

09 Jul 2013 sort_nat: Natural Order Sort Sort strings in natural order. Author: Douglas Schwarz

Contact us