Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This code is trying to create a bookmark in Word from Excel,
The problem is it creates a bookmark that is the whole document rather than just the text <Insert link here Any ideas how to fix this? Thanks, With WordDoc.Content.Find .text = "<Insert link here" If .Execute Then WordDoc.Bookmarks.Add Name:="bmRlsPlan", Range:=WordDoc.Content End If End With |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You might get more help in the Word programming newsgroup, but the
following may work for you: '=============== Dim rngFind As Range Set rngFind = WordDoc.Content With rngFind.Find .Text = "<Insert link here" If .Execute Then rngFind.Bookmarks.Add _ Name:="bmRlsPlan", Range:=rngFind End If End With '========================= Shawn G. wrote: This code is trying to create a bookmark in Word from Excel, The problem is it creates a bookmark that is the whole document rather than just the text <Insert link here Any ideas how to fix this? Thanks, With WordDoc.Content.Find .text = "<Insert link here" If .Execute Then WordDoc.Bookmarks.Add Name:="bmRlsPlan", Range:=WordDoc.Content End If End With -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This line gives an error, Compile error: Argument not optional
Any way around this? With rngFind.Find thanks, "Debra Dalgleish" wrote: You might get more help in the Word programming newsgroup, but the following may work for you: '=============== Dim rngFind As Range Set rngFind = WordDoc.Content With rngFind.Find .Text = "<Insert link here" If .Execute Then rngFind.Bookmarks.Add _ Name:="bmRlsPlan", Range:=rngFind End If End With '========================= Shawn G. wrote: This code is trying to create a bookmark in Word from Excel, The problem is it creates a bookmark that is the whole document rather than just the text <Insert link here Any ideas how to fix this? Thanks, With WordDoc.Content.Find .text = "<Insert link here" If .Execute Then WordDoc.Bookmarks.Add Name:="bmRlsPlan", Range:=WordDoc.Content End If End With -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Change the first line to:
Dim rngFind As Word.Range and it should work correctly. Shawn G. wrote: This line gives an error, Compile error: Argument not optional Any way around this? With rngFind.Find thanks, "Debra Dalgleish" wrote: You might get more help in the Word programming newsgroup, but the following may work for you: '=============== Dim rngFind As Range Set rngFind = WordDoc.Content With rngFind.Find .Text = "<Insert link here" If .Execute Then rngFind.Bookmarks.Add _ Name:="bmRlsPlan", Range:=rngFind End If End With '========================= Shawn G. wrote: This code is trying to create a bookmark in Word from Excel, The problem is it creates a bookmark that is the whole document rather than just the text <Insert link here Any ideas how to fix this? Thanks, With WordDoc.Content.Find .text = "<Insert link here" If .Execute Then WordDoc.Bookmarks.Add Name:="bmRlsPlan", Range:=WordDoc.Content End If End With -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
hOW TO CREATE A BOOKMARK IN EXCEL+ | Excel Worksheet Functions | |||
how to create a bookmark automatically in Excel? | Excel Discussion (Misc queries) | |||
Excel formula using bookmark name: create click-link | Excel Worksheet Functions | |||
hyperlink from Excel to a Word bookmark | Excel Discussion (Misc queries) | |||
hyperlink in excel to a bookmark in a pdf | Excel Discussion (Misc queries) |