Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copying graph from Excel to Word
Message
De
24/12/2007 12:41:44
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
23/12/2007 03:43:14
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01277203
Message ID:
01277372
Vues:
20
>Hi there, I'm trying to paste some graphes I generated on Excel into a Word Document.
>Is there anybody who can help me in doing it ?
>
>Actually I can copy the graph on my clipboard and paste them in a Word document using the "PasteAndFormat" or "PasteSpecia" methods but I can't manage the image I pasted. I don't know how to move it or resize it in Word.
>Thank you so much
>Alessio
>
>By the way, I need to do that because I have to print the graph on a background picture and I don't know if it is possible to do it in Excel :)

If the background picture is always the same, add a picture object to your XLS template file, make it as big as you need and make it have the picture you want. Then rightclick, send to back, so your graph is on top of the picture.

If the picture is different every time, you would have to insert it and fix the size. Instead of having the numbers set programmatically, I had a placeholder object - a shape - which held the position and size, then... something like this:
*-- cImg is the full path to your .jpg file or what have you
oImgRange=opg1.shapes("imgPlaceHolder")
op=opg1.PictureS.Insert(cImg)
This.fitImage(oImgRange, op)

*---------
Procedure fitImage(oImgRange, op)
Local ... && pretty much everything should be local
		nHeight=oImgRange.Height
		nWidth=oImgRange.Width
*-- more code here to calculate the size, while keeping it proportional, not stretch

		op.Top=oimgRange.Top+nVDiff
		op.Left=oImgRange.Left+nHDiff
*-- remove the placeholder
		oImgRange.Delete()
*-- now we need something like this, but not sure how it goes in Excel:
		op.zorder(1)

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform