Bonjour
Je voudrai "traduire" du code C++ builder qui pilote Word à l'aide des composants office XP (TWordApplication...) vers du code directement en Ole
exple apres le commentaire pour inclure une "3.jpg" mais l'équivalent en OleFunction ne marche pas


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
 
// InlineShape * Shape=WordApplication1->Selection->InlineShapes->AddPicture( WideString(FilePath+"3.jpg"),
//                                       (OleVariant)false, (OleVariant)true, EmptyParam);
 vMSWord.OlePropertyGet("Selection").OleFunction("InlineShapes",WideString(FilePath+"3.jpg"),
                    (OleVariant)false, (OleVariant)true, EmptyParam);
// Shape->LockAspectRatio = msoTrue;
// if (Shape->Height!=0) ratio=200.0/Shape->Height;
//     else      ratio=1;
// Shape->Height *=ratio;
// Shape->Width *=ratio;
(exple visible sur http://www.baghli.com/bcb_ole.php)

Merci pour tte aide