How I can insert the MATLAB figure into a specific line of the document Word not at the beginning or end of the document?
4 views (last 30 days)
Show older comments
I have a problem for which I have not find a solution, I have a word document containing text and tables. I have to Copy or Import a figure from MATLAB into Word document. i use the following Sub-function of by Andreas Karlsson to paste the figure but in the end of document :
function FigureIntoWord(actx_word_p)
% Capture current figure/model into clipboard:
open_system('model','loadonly');
print('-dmeta','-sModel');
% Find end of document and make it the insertion point:
end_of_doc = get(actx_word_p.activedocument.content,'end');
set(actx_word_p.application.selection,'Start',end_of_doc);
set(actx_word_p.application.selection,'End',end_of_doc);
% Paste the contents of the Clipboard:
figure = actx_word_p.Selection;
invoke(figure,'Paste');
actx_word_p.Selection.TypeParagraph; %enter
return
first question : Does anyone know how I can modify this code to insert the image into a specific line of the document not at the beginning or end of the document?
second question : if I have to insert the figure after specific table, how can I do ?
2 Comments
Kristi
on 14 Feb 2016
It may be easier to just copy and paste the figure. Go to Edit >> Copy Figure and paste in the actual word document
per isakson
on 14 Feb 2016
Answers (0)
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!