matlab - ActiveX control of Word. Select text and images -
this have done far:
word = actxserver('word.application'); document = word.documents.open('c:\documents , settings\kz7213\desktop\test.docx'); selection = word.selection; selection.typetext('big finale'); selection.style='heading 1'; selection.typeparagraph; fig1 = figure('visible','off'); plot([1 2 3 4 5],[4 1 3 5 7]); print -dmeta selection.paste; selection.style='heading 1'; selection.insertcaption('figure','test figure 1'); %not working selection.style='captionstyle'; selection.typeparagraph;
how can select previous entered text such "big finale" edit it, or select figure pasted selection. paste command in order make caption image?
possible solution in vba ms word:
'to find text selection.find.execute findtext:="big finale", wrap:=wdwrapalways 'to select inline shape activedocument.inlineshapes(1).select
alternative solution find inlineshape(s) use .find.execute method
following settings:
selection.find.execute findtext:="/", wrap:=wdwrapalways, matchwildcards:=true
Comments
Post a Comment