Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-11-2015, 01:20 PM
macropod's Avatar
macropod macropod is offline How to create hyperlinks within a table in Word 2010? Windows 7 64bit How to create hyperlinks within a table in Word 2010? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,496
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default


Quote:
Originally Posted by dougie1809 View Post
Thank you for your reply. The cells do not contain the same text, they contain different PDF file names.
If you want help solving a problem, you should avoid providing misleading information. While you now say the cells don't contain the same text, the table in your attachment does contain the same text in every cell in column 2.

Hopefully, you have now correctly stated your requirements, for which you could use a macro like:
Code:
Sub Demo()
Dim Rng As Range, TblCell As Cell, StrTxt As String
With Selection
  If .Information(wdWithInTable) = False Then Exit Sub
  For Each TblCell In .Cells
    Set Rng = TblCell.Range
    With Rng
      .End = .End - 1
      StrTxt = .Text
      .Text = ""
    End With
    ActiveDocument.Hyperlinks.Add Anchor:=Rng, _
      Address:="Address", SubAddress:="SubAddress", _
      ScreenTip:="", TextToDisplay:=StrTxt, Target:="_blank"
  Next
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 10-12-2015, 03:21 AM
dougie1809 dougie1809 is offline How to create hyperlinks within a table in Word 2010? Windows 7 64bit How to create hyperlinks within a table in Word 2010? Office 2010 32bit
Novice
How to create hyperlinks within a table in Word 2010?
 
Join Date: Oct 2015
Posts: 4
dougie1809 is on a distinguished road
Thumbs up

Quote:
Originally Posted by macropod View Post
If you want help solving a problem, you should avoid providing misleading information. While you now say the cells don't contain the same text, the table in your attachment does contain the same text in every cell in column 2.

Hopefully, you have now correctly stated your requirements, for which you could use a macro like:
Code:
Sub Demo()
Dim Rng As Range, TblCell As Cell, StrTxt As String
With Selection
  If .Information(wdWithInTable) = False Then Exit Sub
  For Each TblCell In .Cells
    Set Rng = TblCell.Range
    With Rng
      .End = .End - 1
      StrTxt = .Text
      .Text = ""
    End With
    ActiveDocument.Hyperlinks.Add Anchor:=Rng, _
      Address:="Address", SubAddress:="SubAddress", _
      ScreenTip:="", TextToDisplay:=StrTxt, Target:="_blank"
  Next
End With
End Sub
Thank you again for your reply. My mistake for the confusion, I was suppose to say it will be referring to different text per line.

However your macro worked really well. I can now use that as an icon in Word.

Kind regards,

Doug
Reply With Quote
Reply

Tags
hyperlink, marco, table border, word 2010



Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Word 2010 Master Document - hyperlinks not working within subdocuments Daedalus Word 2 04-17-2015 08:45 AM
Word 2010 changes hyperlinks format Jeepster Word 5 03-16-2013 04:41 PM
Hyperlinks blocked in Word 2010 spirit777 Word 1 10-15-2011 05:56 AM
Create Hyperlinks from Word to specific location in PDF sukanyae Word 0 02-25-2010 04:08 PM
Word with frames, table of contents, and hyperlinks to html NHMC Word 0 12-09-2009 12:54 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:17 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft