View Single Post
 
Old 05-19-2016, 08:00 AM
Izzie7 Izzie7 is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Nov 2014
Location: Israel
Posts: 5
Izzie7 is on a distinguished road
Default Format figure pasted from browser

After pasting a figure from browser, I want to remove the hyperlink and resize the shape. I tried recording the steps but the resize did not recored and what did record was this:
Sub Macro1()
'
' Macro1 Macro
'
'
Selection.PasteAndFormat (wdPasteDefault)
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.ShapeRange.Hyperlink.Delete
End Sub

When run, the hyperlink was removed, but then the macro stopped with an error message.
How can this simple task be done with VBA?
I thank you in advance!
Reply With Quote