|
|
Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
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?
|
|
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"
-- 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
"Patrick Simonds" <ordnance1[ at ]comcast.net> wrote in message news:uo6mG2rzGHA.4796[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text] >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? >
|
|
Thanks for your reply.
Is there any way to set it so that the graphic displays in front of the text?
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> wrote in message news:uMkrS%23rzGHA.1288[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text] > 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" > > > -- > 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 > > "Patrick Simonds" <ordnance1[ at ]comcast.net> wrote in message > news:uo6mG2rzGHA.4796[ at ]TK2MSFTNGP06.phx.gbl... >>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? >> > >
|
|
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.
[Quoted Text] > Thanks for your reply. > > Is there any way to set it so that the graphic displays in front of the > text? > > > "Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> wrote in message > news:uMkrS%23rzGHA.1288[ at ]TK2MSFTNGP03.phx.gbl... >> 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" >> >> >> -- >> 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 >> >> "Patrick Simonds" <ordnance1[ at ]comcast.net> wrote in message >> news:uo6mG2rzGHA.4796[ at ]TK2MSFTNGP06.phx.gbl... >>> 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? >>> >> >> > >
-- Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
|
|
Oops, That third question should have been: Do you want the picture to cover up text and not let text under it show through?
[Quoted Text] > 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? > A watermark inserts behind text allowing text to show through, but a > watermark is usually applied to the whole page. > >> Thanks for your reply. >> >> Is there any way to set it so that the graphic displays in front of the >> text? >> >> >> "Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> wrote in message >> news:uMkrS%23rzGHA.1288[ at ]TK2MSFTNGP03.phx.gbl... >>> 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" >>> >>> >>> -- >>> 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 >>> >>> "Patrick Simonds" <ordnance1[ at ]comcast.net> wrote in message >>> news:uo6mG2rzGHA.4796[ at ]TK2MSFTNGP06.phx.gbl... >>>> 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? >>>> >>> >>> >> >>
-- Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
|
|
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.
"Russ" <drsN0SPAMmikle[ at ]hotmailD0Tcom.INVALID> wrote in message news:C11F9689.123A5%drsN0SPAMmikle[ at ]hotmailD0Tcom.INVALID...
[Quoted Text] > 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? >> A watermark inserts behind text allowing text to show through, but a >> watermark is usually applied to the whole page. >> >>> Thanks for your reply. >>> >>> Is there any way to set it so that the graphic displays in front of the >>> text? >>> >>> >>> "Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> wrote in message >>> news:uMkrS%23rzGHA.1288[ at ]TK2MSFTNGP03.phx.gbl... >>>> 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" >>>> >>>> >>>> -- >>>> 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 >>>> >>>> "Patrick Simonds" <ordnance1[ at ]comcast.net> wrote in message >>>> news:uo6mG2rzGHA.4796[ at ]TK2MSFTNGP06.phx.gbl... >>>>> 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? >>>>> >>>> >>>> >>> >>> > > -- > Russ > > drsmN0SPAMikleAThotmailD0Tcom.INVALID >
|
|
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)
[Quoted Text] > 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. > > > > "Russ" <drsN0SPAMmikle[ at ]hotmailD0Tcom.INVALID> wrote in message > news:C11F9689.123A5%drsN0SPAMmikle[ at ]hotmailD0Tcom.INVALID... >> 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? >>> A watermark inserts behind text allowing text to show through, but a >>> watermark is usually applied to the whole page. >>> >>>> Thanks for your reply. >>>> >>>> Is there any way to set it so that the graphic displays in front of the >>>> text? >>>> >>>> >>>> "Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> wrote in message >>>> news:uMkrS%23rzGHA.1288[ at ]TK2MSFTNGP03.phx.gbl... >>>>> 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" >>>>> >>>>> >>>>> -- >>>>> 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 >>>>> >>>>> "Patrick Simonds" <ordnance1[ at ]comcast.net> wrote in message >>>>> news:uo6mG2rzGHA.4796[ at ]TK2MSFTNGP06.phx.gbl... >>>>>> 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? >>>>>> >>>>> >>>>> >>>> >>>> >> >> -- >> Russ >> >> drsmN0SPAMikleAThotmailD0Tcom.INVALID >> > >
-- Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID
|
|
|