Hello,
I have a simple table (4x10) in Word and I would like to add hyperlink to cells in a certain column. Can you please tell me why this code doesnt work? It says "command was not successful".
The code changes the text, but stops at the hyperlink part. Thank you for your suggestions.
M.
I have a simple table (4x10) in Word and I would like to add hyperlink to cells in a certain column. Can you please tell me why this code doesnt work? It says "command was not successful".
Code:
Sub something()
With ActiveDocument.Tables(1)
For i = 2 To .Rows.Count
.Cell(i, 2).Select
Selection.Range.Text = "Link"
Selection.Hyperlinks.Add Anchor:=.Selection, Address:="www.microsoft.com"
Next i
End With
End Sub
The code changes the text, but stops at the hyperlink part. Thank you for your suggestions.
M.
Last edited by a moderator: