Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to keep graphics in Word
Message
De
10/08/2007 15:52:19
 
 
À
10/08/2007 15:33:37
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Divers
Thread ID:
01247489
Message ID:
01247516
Vues:
19
>>>I'm creating a graph in Word, by creating a canvas and then adding lines, dots, tiny circles, textboxes etc. The graph is of a very special nature, so please don't recommend other graphing tools, thanks, they just can't do this. This actually works quite nicely in Word.
>>>
>>>The problem arises when I try to add a page - this report is supposed to have one graph per page. When I do
>>>
>>>oDoc.InsertBreak(wdPageBreak)
>>>
>>>oDoc.Shapes.Count goes to zero. IOW, my canvas vanishes. Tried other things - add a paragraph, select it, create a canvas, it anchors to the paragraph, but the paragraph text vanishes. Then I try to set the paragraph's text, the canvas vanishes.
>>>
>>>Is there any system to this? I'd like to just build the document, not to hunt its vanishing parts.
>>
>>This is a SWAG, but what might be happening is that, when you fire the command to create a new page, the "focus" is still on your graphic, so it's replaced by the Page Break. Maybe you could try moving the "focus" off your graphics (e.g. by adding a CRLF just after them) and then try the page break.
>
>And vice versa... experimenting further, anything selected when a canvas is added is replaced by the canvas.
>
>Of course, Word knows how to do that from the menu. Just click the textbox on the drawing toolbar and it draws a canvas at the insertion point, with "Place your text here" in large friendly font all over it, but guess what - it doesn't work if you're recording a macro.
>
>FWIW, using Office 2003, and its help is nearly worthless. There's close to zero information on how to anchor a canvas - except that the last parameter should be a range to anchor to. Well, it can't be just about any range, it needs to be document.selection (at least nothing else worked so far). Now I only need to find a way to not select the whole paragraph... or to just sacrifice an empty one.

Is there a way to select "nothing" - i.e. an empty range, or a range where the start and stop are the same? The same idea as an actual Word document - you can have a current insertion point without any text or graphics being selected.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform