![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#2
|
|||
|
|||
|
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 |
| Tags |
| height, picture, width |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help - Run-time error 91 - VBA for inserting and formatting text depending on style | mtrborges | Word VBA | 2 | 02-08-2015 11:35 PM |
| Lost photo content after rotating photos using MS Picture Manager | jefflyon | Office | 1 | 08-22-2014 11:57 PM |
Height and Width blank - Excel Chart in Powerpoint
|
Metronome | PowerPoint | 1 | 04-06-2012 06:20 AM |
Rotating a picture in a picture box
|
Cath5000 | PowerPoint | 1 | 01-18-2012 03:04 PM |
Word is inserting bold page-width lines without permission!
|
kozureokami | Word | 6 | 05-22-2011 02:59 PM |