Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using the Range Object in the AddPicture Method
Message
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Using the Range Object in the AddPicture Method
Divers
Thread ID:
00089410
Message ID:
00089410
Vues:
82
Hi there,

I'm trying to control a Word document from VFP via VBA, and so far have been fairly successful. However, when I try to use the AddPicture method for InlineShapes, I am unsuccessful in specifying the range between two bookmarks where the picture will be placed in the document. I either get a syntax error or the picture is placed at the beginning of the document.

Here is the code I'm using to place the picture in the specified range:

this.dv_oOleApp.ActiveDocument.Bookmarks.Add("ACG_BEGIN_PICTURE")
this.dv_oOleApp.Selection.TypeText("This is where the picture will go")
this.dv_oOleApp.ActiveDocument.Bookmarks.Add("ACG_END_PICTURE")
this.dv_oOleApp.ActiveDocument.Range(this.dv_oOleApp.ActiveDocument.Bookmarks("ACG_BEGIN_PICTURE").Range.Start, ;
this.dv_oOleApp.ActiveDocument.Bookmarks("ACG_END_PICTURE").Range.Start)


this.dv_oOleApp.ActiveDocument.InlineShapes.AddPicture("y:\users\ben\wwwinappr\prop1.jpg",.t.,.t.,this.dv_oOleApp.ActiveDocument.Range)


What am I doing wrong?

Thanks,

Ben Holton
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform