View Single Post
 
Old 11-01-2017, 06:36 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Not exactly sure what you are after but maybe:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 11/1/2017
Dim strFile As String
Dim oILS As InlineShape, oShp As Shape
Dim bRotate As Boolean
  
  bRotate = False
  With Dialogs(wdDialogInsertPicture)
    .Display
    If .Name <> "" Then strFile = .Name
  End With
  If strFile <> vbNullString Then
    Set oILS = Selection.InlineShapes.AddPicture(strFile)
    With oILS
      If .Width < .Height Then
        Set oShp = .ConvertToShape
        oShp.IncrementRotation 90
        bRotate = True
      End If
    End With
    If bRotate Then Set oILS = oShp.ConvertToInlineShape
    With oILS
      .LockAspectRatio = msoTrue
      If bRotate Then
        .Width = CentimetersToPoints(4.318)
      Else
        .Height = CentimetersToPoints(4.318)
      End If
      MsgBox .Height & " " & .Width
    End With
 End If
 Set oILS = Nothing: Set oShp = Nothing
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote