Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using loadpicture in Word
Message
From
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:
00515159
Views:
26
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform