Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Creating a hyperlink in Word from Excel

I am creating a word document using Excel and I need to add a hyperlink at a
given position in the text. For some reason the following code does not work.
WordApp has already been dim'ed.


With WordApp.ActiveDocument
.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"http://www.asdfasdfasfd.com", SubAddress:="", _
ScreenTip:="", TextToDisplay:="Activity"
End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Creating a hyperlink in Word from Excel

About the only thing I do with MSWord is record macros and try to tweak them.

But Selection.Range doesn't look like it belongs to the MSWord application.

I'd try:

With WordApp.ActiveDocument
.Hyperlinks.Add Anchor:=.Range, Address:= _
"http://www.asdfasdfasfd.com", SubAddress:="", _
ScreenTip:="", TextToDisplay:="Activity"
End With



Ariel wrote:

I am creating a word document using Excel and I need to add a hyperlink at a
given position in the text. For some reason the following code does not work.
WordApp has already been dim'ed.

With WordApp.ActiveDocument
.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"http://www.asdfasdfasfd.com", SubAddress:="", _
ScreenTip:="", TextToDisplay:="Activity"
End With


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Creating a hyperlink in Word from Excel

Without specifically defining the location where this should be inserted,
everything else in the document is deleted.

"Dave Peterson" wrote:

About the only thing I do with MSWord is record macros and try to tweak them.

But Selection.Range doesn't look like it belongs to the MSWord application.

I'd try:

With WordApp.ActiveDocument
.Hyperlinks.Add Anchor:=.Range, Address:= _
"http://www.asdfasdfasfd.com", SubAddress:="", _
ScreenTip:="", TextToDisplay:="Activity"
End With



Ariel wrote:

I am creating a word document using Excel and I need to add a hyperlink at a
given position in the text. For some reason the following code does not work.
WordApp has already been dim'ed.

With WordApp.ActiveDocument
.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"http://www.asdfasdfasfd.com", SubAddress:="", _
ScreenTip:="", TextToDisplay:="Activity"
End With


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Creating a hyperlink in Word from Excel

Maybe it's time to ask in an MSWord newsgroup.



Ariel wrote:

Without specifically defining the location where this should be inserted,
everything else in the document is deleted.

"Dave Peterson" wrote:

About the only thing I do with MSWord is record macros and try to tweak them.

But Selection.Range doesn't look like it belongs to the MSWord application.

I'd try:

With WordApp.ActiveDocument
.Hyperlinks.Add Anchor:=.Range, Address:= _
"http://www.asdfasdfasfd.com", SubAddress:="", _
ScreenTip:="", TextToDisplay:="Activity"
End With



Ariel wrote:

I am creating a word document using Excel and I need to add a hyperlink at a
given position in the text. For some reason the following code does not work.
WordApp has already been dim'ed.

With WordApp.ActiveDocument
.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
"http://www.asdfasdfasfd.com", SubAddress:="", _
ScreenTip:="", TextToDisplay:="Activity"
End With


--

Dave Peterson


--

Dave Peterson
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
Creating a hyperlink in Excel. john vizurraga Excel Discussion (Misc queries) 2 January 14th 09 09:41 AM
Excel Hyperlink doesn't open Word doc the same way as Word does duugg Excel Discussion (Misc queries) 2 October 12th 06 03:14 PM
Creating a Hyperlink from a Single Word Kara Links and Linking in Excel 1 July 1st 06 12:40 PM
Creating Hyperlink in excel 2003 VBA sweet_dreams Excel Programming 2 March 7th 06 01:20 PM
CREATING HYPERLINK IN EXCEL STARFINANCIALGROUP Excel Discussion (Misc queries) 1 January 26th 06 06:29 PM


All times are GMT +1. The time now is 08:06 PM.

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

About Us

"It's about Microsoft Excel"