VBA for Cutting and Pasting Hyperlinks in Word 2007

Author Message
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)
0
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!
 
#1
    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)
    0
    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"
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2
      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)
      0
      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>
       
      #3
        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)
        0
        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>.
         
        #4
          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)
          0
          Thank you!
           
          #5

            Online Bookmarks Sharing: Share/Bookmark

            Jump to:

            Current active users

            There are 0 members and 1 guests.

            Icon Legend and Permission

            • New Messages
            • No New Messages
            • Hot Topic w/ New Messages
            • Hot Topic w/o New Messages
            • Locked w/ New Messages
            • Locked w/o New Messages
            • Read Message
            • Post New Thread
            • Reply to message
            • Post New Poll
            • Submit Vote
            • Post reward post
            • Delete my own posts
            • Delete my own threads
            • Rate post

            2000-2012 ASPPlayground.NET Forum Version 3.9