Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

Inserting a graphic

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Patrick Simonds - 02 Sep 2006 19:27 GMT
I have a UserForm which is used to place text into a document based on user
input, and the code looks like this:

Selection.GoTo What:=wdGoToBookmark, name:="Relationship"
   Selection.SelectCell
   Selection.Text = "Husband"

What I want to do now is go to a Bookmark called Picture and have a picture
(graphic) inserted at that point. I want the picture to display in front of
any text. The path to the picture would look like:

c:/My Documents/Pat.gif

Any ideas out there?
Doug Robbins - Word MVP - 02 Sep 2006 19:42 GMT
For the text, you should just use:

ActiveDocument.Bookmarks("Relationship".Range.InsertBefore "Husband"

For the Graphic, use:

ActiveDocument.Bookmarks("Picture").Range.InlineShapes.AddPicture
Filename:="c:/My Documents/Pat.gif"

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

>I have a UserForm which is used to place text into a document based on user
>input, and the code looks like this:
[quoted text clipped - 10 lines]
>
> Any ideas out there?
Patrick Simonds - 03 Sep 2006 00:03 GMT
Thanks for your reply.

Is there any way to set it so that the graphic displays in front of the
text?

> For the text, you should just use:
>
[quoted text clipped - 19 lines]
>>
>> Any ideas out there?
Russ - 03 Sep 2006 01:06 GMT
Patrick,

In front of what text? Do you want the picture to move text out of the way
when inserting itself? Do you want text to cover up and not let text under
it show through? Or is it the word "Husband" that gets destroyed when the
picture is inserted into the bookmark that you want to keep?
A watermark inserts behind text allowing text to show through, but a
watermark is usually applied to the whole page.

> Thanks for your reply.
>
[quoted text clipped - 24 lines]
>>>
>>> Any ideas out there?

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Russ - 03 Sep 2006 01:14 GMT
Oops,
That third question should have been:
Do you want the picture to cover up text and not let text under
it show through?

> Patrick,
>
> In front of what text? Do you want the picture to move text out of the way
> when inserting itself? Do you want (text oops) to cover up and not let text
under
> it show through? Or is it the word "Husband" that gets destroyed when the
> picture is inserted into the bookmark that you want to keep?
[quoted text clipped - 29 lines]
>>>>
>>>> Any ideas out there?

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Patrick Simonds - 03 Sep 2006 01:47 GMT
I am looking for the equivalent of selecting In Front of Text. I do not want
the text moved just the graphic place on top.

> Oops,
> That third question should have been:
[quoted text clipped - 42 lines]
>>>>>
>>>>> Any ideas out there?
Russ - 03 Sep 2006 06:42 GMT
Patrick,

Open the Word menu 'View | Toolbars-->Picture' to manipulate the picture you
added with Doug's code. Select the picture. When you 'Format' the picture to
something other than InLine With Text, the picture floats and isn't anchored
as well as InLine. But with a floating picture, you can change the layer
depth order. Record a macro while using that toolbar to alter the layer
depth order to see the VBA code you can use for automation. (See .Zorder
method in VBA Help)

> I am looking for the equivalent of selecting In Front of Text. I do not want
> the text moved just the graphic place on top.
[quoted text clipped - 45 lines]
>>>>>>
>>>>>> Any ideas out there?

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.