Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting pictures in a word document

Status
Not open for further replies.

worky24

Programmer
Aug 20, 2003
13
RO
Hello all!

I have to create badges (identity cards) for about 1000 people, which will contain name, surname, department, id, picture and some text. I have an Word template with 6 badges on a page (A4), and I have to replicate this to create badges for all people.
The info for people is stored in a table, using a general field for picture. Also, the pictures are available as separate files (.jpg).
Please, give me some ideeas to acomplish this task (I'm begginer using automation).

Thank you,

worky
 
You don't really need automation since you have the pictures available as .jpgs.
You can create a report form or a label form, add an image control and set the picture property to the field name in your table.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Dave,

I can't use a report because every card (of six on the page) have "face" and "back" (it will be cut and then folded to create the card); on the back of the card, the text is rotated with 90 degrees, a thing I can't do with a report; not to mention that there are some borders for face of the card and for text on the back - very hard to reproduce with a report.

worky
 
Hi!
Although I didnot test yet I do think that with the new reportgenerator of VFP9 you can rotate text though?
-Bart
 
Nifrabar is right, you can manipulate text that way using VFP 9 with it's GDI+ capabilities.
If you want to stick with some sort of Word automation though, I would suggest you re-post your query in this forum:

Microsoft: VFP - Automation, Mail & 3rd Party Svcs


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Here's a bit of my code which puts images into a Word report from external jpg files

Code:
	objPicture = .InlineShapes.AddPicture(mypict , .F., .T.) 

WITH objPicture

*!*	' Modify picture properties'
		ht = .height
		wd = .width

&& manipulate factor based on experience

factor = ( something you calculate)


		.ScaleHeight= factor
		.ScaleWidth= (factor * 1.01)
		.Fill.Visible = .f.
		.Fill.Transparency = 0
		.Line.Weight = 1.4
		.Line.Transparency = 0
		.Line.Visible = .t.
		.LockAspectRatio = .f.
		.PictureFormat.CropLeft = 0
		.PictureFormat.CropRight = 0
		.PictureFormat.CropTop = 0
		.PictureFormat.CropBottom = 0
	ENDWITH

HTH

Eric
 

Worky,

Here's some code that I have used to do this:

Code:
lnPos = <position of picture relative to start of doc>
lcFile = <path and filename of graphic file>
loRange = oDoc.Range(lnPos, lnPos)
loPict = loRange.InLineShapes.AddPicture(lcFile)

In addition, you can make all the adjustments that Eric suggested, using the properties of the loPict object.


Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top