Can Word 2007 remember and repeat a process?

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

I have a table which contains a company name in the first column and their
web address in the second column. I want to make the name in the first column
a hyperlink using the address in the second column. So I copy the web
address, highlight the name, click on hyperlink and past the web address then
click OK.

Works great, but I have over 1,000 names. I'm getting "mouse finger" and
very bored.

Can I make Word 2007 do this automatically for me?
 
You might see whether F4 will do what you want.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
This sounds like something you could solve with a macro. Unfortunately,
Word's macro recorder doesn't always do exactly what we want or expect. In
this case, when you copy the link to the clipboard in recording the macro,
Word uses exactly what you copied in the resulting hyperlink command, rather
than a pointer to whatever happens to be in the clipboard. So, for the
recorded macro to work, you need to intervene, and substitute the value of
the clipboard (link$ in this case) for the address captured by the recorder.

If you click at the beginning of the first cell that contains the link, then
run this macro (which I just recorded and modified as indicated), it will
use the web address to make a link using the cell to the left. It will then
automatically move the insertion point to the beginning of the second cell
in the next row.

Sub Macro35()
On Error Resume Next
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
link$ = Selection()
Selection.HomeKey Unit:=wdLine
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdLine, Extend:=wdExtend
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:=link$
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveDown Unit:=wdLine, Count:=1
End Sub

No frills... but it does what you want (at least from your description... I
tested it here, and it works). Create the macro, test it, put it on the QAT
(or assign it to a keystroke), and click the tool (or press the keystroke)
however many times it takes to work its way through the table.
 
Thanks Herb.

Prior to seeing your reply, I copied the table into Excel and tried a macro
- adding a hyperlink to column C using the address from column B and the name
from Column A. Unfortunately, when I ran the macro, it thought A1 was an
absolute address instead of a relative address so all the links had the same
name.

But, I found a hyperlink formula under Formulas, Lookup & Reference. Put the
formula in C1 and copied it to the other 1,000 rows and it worked like a
charm!

Where there's a will there's a way!

Thanks again - I'm sure your macro would have been easier.
 
I often use Excel to solve problems for which a Word method either is absent
or too convoluted. I'm glad to see you found something that did what you
needed.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top