![]() |
#3
|
||||
|
||||
![]() Quote:
Code:
Sub InsertPic() Dim strFile As String, iShp As InlineShape, Shp As Shape, Rng As Range On Error Resume Next With Dialogs(wdDialogInsertPicture) .Display If .Name <> "" Then strFile = .Name Else Exit Sub End If End With Set Rng = Selection.Range: Rng.Collapse wdCollapseEnd Set iShp = ActiveDocument.InlineShapes.AddPicture(strFile, False, True, Rng) Set Shp = iShp.ConvertToShape With Shp .LockAnchor = True .LockAspectRatio = msoTrue .Height = .Height / 2 .RelativeVerticalPosition = wdRelativeVerticalPositionLine .Top = 0 .RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin .Left = wdShapeCenter End With Set Rng = Nothing: Set iShp = Nothing: Set Shp = Nothing End Sub https://www.msofficeforums.com/word-...html#post47919
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
puff | Word VBA | 5 | 12-17-2017 05:52 PM |
![]() |
TedW | Excel | 1 | 11-17-2015 10:11 PM |
![]() |
Jazz | Outlook | 1 | 09-10-2015 04:34 AM |
![]() |
phamh | PowerPoint | 1 | 02-25-2015 04:40 AM |
Background image vs. insert image | lilaria | PowerPoint | 0 | 04-18-2011 08:45 AM |