View Single Post
  #1   Report Post  
neonico
 
Posts: n/a
Default how does one insert a picture in word?

hi everybody!
here is the code which allows the merging of my table:
code merging of table
oRange = oSelection.GetRange();
oTables = oDoc.GetTables();
oTable = oTables.Add(oRange,nb_lignes,1,vtOptional,vtOption al);
oTable.AutoFormat( vtFormatContemporary, vtOptional, vtOptional,
vtOptional
, vtOptional, vtOptional, vtOptional, vtOptional, vtOptional,
vtOptional);

Cell oCellTitle = oTable.Cell(1,1);
oRange = oCellTitle.GetRange();

oMailMergeFields.Add(oRange, "RUBRIQUES");

// Creation and merging operation in the cells of the table
cellsOfTable( oTable, nb_lignes, oWord, oMailMergeFields);
/ end code merging of table


Here is the code of the inserting of my image
code image
oRange = oSelection.GetRange();
oParagraphs = oRange.GetParagraphs();
oParagraph = oParagraphs.GetLast();
Range oTargetRange = oParagraph.GetRange();

VARIANT vTargetRange;
vTargetRange.vt = VT_DISPATCH;
vTargetRange.pdispVal = TargetRange.m_lpDispatch;

Shapes shapes = oDoc.GetShapes();
shapes.AddPicture("C:\\Documents and Settings\\Administrateur\\Mes
documents\\Mes images\\Matrix.jpg",
vtFalse, vtTrue , vtOptional, vtOptional, vtOptional, vtOptional,
&vTargetRange);
/code image

here
Code merging
...
end code merging

the inserting of the image is placed after my merging tables whereas she
should be between the 2 tables. Why?
In advance, thanks.