Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Using the Range Object in the AddPicture Method
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement