salut
svp
comment écrire dans un fichier Word avec c++ Builder xe3
merci d'avance!!!!
salut
svp
comment écrire dans un fichier Word avec c++ Builder xe3
merci d'avance!!!!
Salut udinacer
regarde la FAQ ici
Tu aura certainement des modifications a effectuer pour gerer l'unicode, mais les codes restent valable
merci
ça marche parfaitement
et comment insérer une image dans le docemment
Pour inserer une image
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 //--------------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; Variant vMSWord, vWDocuments, vWDocument; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { try { vMSWord = Variant::GetActiveObject("Word.Application"); } catch(...) { vMSWord = Variant::CreateObject("Word.Application"); } vMSWord.OlePropertySet("Visible", true); vWDocuments = vMSWord.OlePropertyGet("Documents"); vWDocument = vWDocuments.OleFunction("Add"); vMSWord.OlePropertyGet("Selection").OlePropertyGet("InlineShapes"). OleFunction("AddPicture", "C:\\Users\\home\\Pictures\\IMG_0127.jpg", false, true); } //--------------------------------------------------------------------------- void __fastcall TForm1::Button2Click(TObject *Sender) { vMSWord.OleFunction("Quit"); vMSWord = Unassigned; Application->Terminate(); } //---------------------------------------------------------------------------
lors de l’exécution
le message suivant
type de variable incorrect
Partager