![]() |
|
#2
|
||||
|
||||
|
If you copy an image from the browser the hyperlink doesn't normally come with it, so the error relates to there not being a hyperlink to delete. You can error trap that
Code:
Sub Macro1()
Dim oRng As Range
Dim oLink As Hyperlink
Dim oShape As InlineShape
Set oRng = Selection.Range
oRng.Paste
For Each oLink In oRng.Hyperlinks 'If there is one
oLink.Delete
Next oLink
For Each oShape In oRng.InlineShapes
With oShape
.Width = InchesToPoints(3) 'The width sets the size of the image with the same aspect ratio
End With
Next oShape
lbl_Exit:
Set oRng = Nothing
Set oLink = Nothing
Set oShape = Nothing
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
| Tags |
| hyperlinks, resize objects, shapes |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Caption Order: Figure 4 Figure 3 Figure 2 | golfarchitect13 | Word | 5 | 05-07-2014 07:15 PM |
| Footnotes do not appear when document is pasted into new format | JerryL | Word | 4 | 12-09-2013 04:33 PM |
Figure and Table Numbering Format Change
|
hojkoff | Word | 3 | 06-18-2013 01:57 AM |
auto-format items pasted into document
|
ekphrasis | Word | 1 | 11-01-2010 03:02 PM |
| hyperlinks from copying in web browser are long format... | BERKEY | Word | 0 | 12-14-2007 10:33 AM |