Picture Content Control

M

Martin Stockwell

Working with Word 2007...

i have a macro that runs, and depending on what 2 other boxes have in them
it completes a sql query from BCM 2007 (with custom fields) and places the
results in the specifed Content controls. (no xml is necessary, and has all
been done with a few lines of VBA)....

However, what is the correct code for automatically making the picture
content control a picture...

for instance.....
ActiveDocument.ContentControls.Item(7).Range.Text = "hello world"
adds text to the content control item 7... (which is a text control)
but what is it for a picture control... i thought it might be something like
ActiveDocument.ContentControls.Item(8).Range.InsertFile
("c:\helloworld.gif")
but it errors.... what should it be....

thanks...
 
O

old man

Hi,

You have to put the picture in a textbox and add the text to the textbox. A
caption of a shape is a way of creating automatically numbered captions such
as Figure 1, Figure 2.

It sounds like you want to add text such as Ohio Sales 2006 and for that you
need a textbox.

old man
 
M

Martin Stockwell

Thanks, but thats not what i want to do....

i wont to be able to add a picture to a word document using the picture
content control.... but what is the code for being able to do this in vba....
you can put text in a text box content control via code.... so why cant i put
a picture in a picture content control via code...

cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top