krumrei22
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 7/25/2011
-
Status: offline
|
VBA for Cutting and Pasting Hyperlinks in Word 2007
Monday, July 25, 2011 2:07 AM
( permalink)
I am new to the whole Macro word and am still learning. I have this code: Sub RemoveHyperlinks()Dim i As LongFor i = ActiveDocument.Hyperlinks.Count To 1 Step -1ActiveDocument.Hyperlinks(i).Delete Next i End Sub However, I do not want to DELETE the Hyperlinks, I want to CUT and PASTE them to another part of the word doc. Any help? Thank you!
|
|
|
|
ebgreen
-
Total Posts
:
8227
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
Re:VBA for Cutting and Pasting Hyperlinks in Word 2007
Monday, July 25, 2011 2:46 AM
( permalink)
Well my standard answer for most any macro issue is "Use the macro recorder and see what code it generates then modify that to fit your needs"
|
|
|
|
krumrei22
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 7/25/2011
-
Status: offline
|
Re:VBA for Cutting and Pasting Hyperlinks in Word 2007
Monday, July 25, 2011 3:30 AM
( permalink)
I tired to use my mouse to highlight the word with the hyperolink in it and record a cut and paste, but I the words will not highlight it just shows the little tape recorder tape. Actually what is records is just a Selection.Cut. I need it to be a HTTP:
<message edited by krumrei22 on Monday, July 25, 2011 3:33 AM>
|
|
|
|
59cobalt
-
Total Posts
:
981
- Scores: 91
-
Reward points
:
0
- Joined: 7/17/2011
-
Status: offline
|
Re:VBA for Cutting and Pasting Hyperlinks in Word 2007
Monday, July 25, 2011 5:15 AM
( permalink)
ReDim links(ActiveDocument.Hyperlinks.Count)
For i = 1 To ActiveDocument.Hyperlinks.Count
links(i - 1) = ActiveDocument.Hyperlinks(i).Address
Next The easiest way to find out about methods/properties of a particular object is to type the object name followed by a dot in a VBA macro editor window (e.g. "hyperlinks(i)."). When you type the dot, the IDE will present you with a selection list with all methods and properties of that particular object. Another option is to put the cursor somewhere in the object's name and then hit <F1>.
|
|
|
|
krumrei22
-
Total Posts
:
3
- Scores: 0
-
Reward points
:
0
- Joined: 7/25/2011
-
Status: offline
|
Re:VBA for Cutting and Pasting Hyperlinks in Word 2007
Monday, July 25, 2011 5:52 AM
( permalink)
|
|
|
|