Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Excel create bookmark

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Excel create bookmark

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Excel create bookmark

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Excel create bookmark

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
hOW TO CREATE A BOOKMARK IN EXCEL+ Padre310 Excel Worksheet Functions 0 March 26th 10 01:46 PM
how to create a bookmark automatically in Excel? LunaMoon Excel Discussion (Misc queries) 6 August 12th 08 05:04 PM
Excel formula using bookmark name: create click-link 4mula freak Excel Worksheet Functions 1 February 22nd 08 11:43 PM
hyperlink from Excel to a Word bookmark Bertie Excel Discussion (Misc queries) 2 May 16th 06 07:51 PM
hyperlink in excel to a bookmark in a pdf r Excel Discussion (Misc queries) 0 May 31st 05 09:50 AM


All times are GMT +1. The time now is 05:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"