Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using loadpicture in Word
Message
From
05/06/2001 11:47:47
 
 
To
05/06/2001 11:38:40
Scott Butts
Ims Specialty Services
Twin Falls, Idaho, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00514865
Message ID:
00515164
Views:
112
Hi!

I have no idea. Find a complete help on the property you going to use. I see you tried a lot of different cases with no luck. Maybe .picture = "c:\image.jpg" will work? Another suggestion is to try to use the foll path to the object: Img.OLEFormat.OBJECT.picture...




>Here is a little test. There is an error on the .picture assignment every time.
>
>
>#DEFINE wdOrientLandscape	1
>#DEFINE wdSectionBreakNextPage	2
>
>oWord = CREATEOBJECT('word.application')	&& create the word object
>oWord.documents.ADD("C:\normal.dot",.T.)	&& add document using template, make it new
>oWord.VISIBLE = .T.
>
>WITH oWord.SELECTION
>	.typetext("Testing")
>	.typeparagraph
>	.typeparagraph
>	.typeparagraph
>
>	oWord.ActiveDocument.RANGE(.Start, .Start).InsertBreak(wdSectionBreakNextPage)
>	.Start = .Start + 1
>	WITH oWord.ActiveDocument.RANGE(.Start, oWord.ActiveDocument.Content.END).PageSetup
>		.ORIENTATION = wdOrientLandscape
>	ENDWITH
>
>*Set Img = ActiveDocument.Shapes.AddOLEControl("Forms.Image.1", 0, 9, 648, 414, Selection.Range)
>	Img = oWord.ActiveDocument.Shapes.AddOLEControl("Forms.Image.1", 0, 9, 648, 414, .RANGE)
>
>*ActiveDocument.Shapes.AddOLEControl Anchor:=Selection.Range,ClassType:="Forms.Image.1"
>*Set Img = ActiveDocument.Shapes.Item(1)
>
>	WITH Img.OLEFormat.OBJECT
>		.PictureSizeMode = 3
>		.LEFT = 0
>		.TOP = 9
>		.HEIGHT = 414
>		.WIDTH = 648
>		.BACKCOLOR = RGB(255,255,255)
>		.BORDERCOLOR = RGB(255,255,255)
>
>		.picture = loadpicture("c:\Image.jpg")
>
>*		.picture(loadpicture("c:\image.jpg"))
>				
>*		oImgList = createobject("COMCTL.ImageListCtrl.1")
>*		oImgList.ListImages.Add(,,loadpicture("c:\image.jpg"))
>*		.picture = oImgList.ListImages(1).picture
>**		opicture = oImgList.ListImages(1).picture
>**	    .Picture(oPicture)
>**		.picture = oPicture
>
>*		oform = createobject("form")
>*		set classlib to formimg.vcx additive
>*		oform.addobject("oImg","FormImg")
>*		release classlib forming
>*		oform.oImg.Picture = LoadPicture("c:image.jpg")
>*		oform.visible = .t.
>*		oform.oimg.visible = .t.
>*		wait
>*		.picture = oform.oimg.picture
>
>	ENDWITH
>ENDWITH
>WAIT
>RELEASE oWord
>release opicture
>release oimglist
>release oform
>
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform