title: ActiveX control of Word. Select text and images
body: <p>This is what I have done so far:</p>
  
  <pre><code>word = actxserver('Word.Application');
  
  document = word.documents.Open('C:\Documents and 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;
  </code></pre>
  
  <p>How can I select previous entered text such as "Big Finale" to edit it, or select the figure I pasted with the selection. Paste command in order to make a caption for the image?</p>