Load Picture using Bookmarks

A

Antony

I am an Oralce forms developer and I am trying to create a word doc using
OLE2. The doc contains a picture and I need to pass the filename from Oracle
Forms.
So far I have created some bookmarks and am able to find bookmarks and
replace them with text. But I am unable to do the same for Picture. I tried
with {IncludePicture bookmark1} . It didnt work. Can someone point me some
documents reg replacing bookmarks with filenames to load picture.

Thanks
Antony.
 
J

Jay Freedman

Antony said:
I am an Oralce forms developer and I am trying to create a word doc
using OLE2. The doc contains a picture and I need to pass the
filename from Oracle Forms.
So far I have created some bookmarks and am able to find bookmarks and
replace them with text. But I am unable to do the same for Picture. I
tried with {IncludePicture bookmark1} . It didnt work. Can someone
point me some documents reg replacing bookmarks with filenames to
load picture.

Thanks
Antony.

The "bookmark1" inside the IncludePicture field must be converted to a
field. Select the word bookmark1 and press Ctrl+F9 to add the inner set of
braces, so it appears as

{IncludePicture {bookmark1} }

Then update the fields, and you should see the picture whose path is in the
bookmark. After your Oracle form updates the content of the bookmark, you'll
have to update the IncludePicture field again to get the new picture to
show.

Technically, a field whose code consists of only a bookmark name is
shorthand for the corresponding Ref field; its result is the content of the
bookmark.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
A

Antony

If I write the filename to a textfile, Can word (macro) read the filename and
load the image ??

Antony.
 
A

Antony

Thanks for the reply Jay.

Well I inserted a word field by Ctrl F9 and did the following
{IncludePicture {}}. The problem is how do I see the bookmark. If I do
Insert/Bookmark within the inner curly braces, how do I save it ?

Basically If I do
{IncludePicture "C:\\test.jpg" \d} and press F9 gets me the picture. But I
am unable to do the same by passing the "C:\\test.jpg" as bookmark.
Sorry If I asking a very silly qn or something as this is my first ever word
project.

Thanks
Antony.
 
J

Jay Freedman

Hi Antony,

If Oracle requires you to use a bookmark to tell Word the name of the
picture, that bookmark is going to have to be outside the IncludePicture
field. Only the *name* of the bookmark goes inside the inner field, like

{IncludePicture {bookmark1} \d }

The text C:\test.jpg would be somewhere else in the document, and the
bookmark named bookmark1 would surround that text.

I don't know what other ways Oracle has of passing information to Word. In
another branch of the thread you suggested writing the picture's file name
into a text file. While that seems like it ought to work (using a nested
{IncludeText} field in place of the {bookmark1} field), it fails because the
result of the IncludeText field ends with a paragraph mark that makes the
file name invalid.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
A

Antony

Jay,

Thanks for the reply. As of now the only way I can pass some information to
Word is thru Bookmark. And I can pass only the filename. Is it possible to
use some kind of macro or something to load the picture while opening the
document ?.

Or going back to my thought of writing the filename into a text file, Can I
not mail merge this ?.

Antony.
 
J

Jay Freedman

Hi Antony,

Yes, you can mail merge the file names from an external file. See
http://www.gmayor.com/mail_merge_graphics.htm for instructions. (I
should have thought of that earlier, but I don't do a lot of mail
merges and it's usually the last thing I think of. Sorry!)

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
A

Alisa L

Is the issue the syntax of the INCLUDEPICTURE field? I also use bookmarks to
insert path/filename into the field, but the syntax that works for me is the
following:

{INCLUDEPICTURE "{REF Bookmarkname}"}

The REF field inserts the contents of the bookmark into the INCLUDEPICTURE
field, vs just the bookmark name itself.

Alisa
 

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