Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Can Word 2007 remember and repeat a process?
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? |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Can Word 2007 remember and repeat a process?
You might see whether F4 will do what you want.
-- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Steve" wrote in message ... 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? |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Can Word 2007 remember and repeat a process?
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. -- Herb Tyson MS MVP Author of the Word 2007 Bible Blog: http://word2007bible.herbtyson.com Web: http://www.herbtyson.com "Suzanne S. Barnhill" wrote in message ... You might see whether F4 will do what you want. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Steve" wrote in message ... 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? |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Can Word 2007 remember and repeat a process?
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. "Herb Tyson [MVP]" wrote: 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. -- Herb Tyson MS MVP Author of the Word 2007 Bible Blog: http://word2007bible.herbtyson.com Web: http://www.herbtyson.com "Suzanne S. Barnhill" wrote in message ... You might see whether F4 will do what you want. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Steve" wrote in message ... 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? |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Can Word 2007 remember and repeat a process?
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, -- Herb Tyson MS MVP Author of the Word 2007 Bible Blog: http://word2007bible.herbtyson.com Web: http://www.herbtyson.com "Steve" wrote in message ... 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. "Herb Tyson [MVP]" wrote: 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. -- Herb Tyson MS MVP Author of the Word 2007 Bible Blog: http://word2007bible.herbtyson.com Web: http://www.herbtyson.com "Suzanne S. Barnhill" wrote in message ... You might see whether F4 will do what you want. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "Steve" wrote in message ... 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? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word 2007 Repeat Button | Microsoft Word Help | |||
MS Word 2007 .dotx can not remember Password protection on re-open | Microsoft Word Help | |||
Word 2007 Beta - Table, Repeat Heading, Don't Break Across Page B | Tables | |||
I can't remember the name of a saved document but I do remember s. | Microsoft Word Help | |||
Word's User Process shutdown Automation process | Microsoft Word Help |