#1
|
|||
|
|||
Resize {IncludePicture} - avoid 'Selection'
Hi to all,
I just finished the following macro, but I'd like to run it without 'Selection'. Unfortunately I do not know how to 'Set' the found { IncludePicture } field to something. Code:
Sub ResizeIncludePicture() Dim oField As Field, dFactor As Double Const cNewWidth = 5 For Each oField In ActiveDocument.Fields If oField.Type = wdFieldIncludePicture Then oField.Select With Selection.InlineShapes(1) dFactor = .Height / .Width .Width = CentimetersToPoints(cNewWidth) .Height = dFactor * .Width End With Next End Sub NP |
#2
|
||||
|
||||
You could use:
Code:
Sub ResizeIncludePicture() Dim oField As Field, dFactor As Double Const cNewWidth = 5 For Each oField In ActiveDocument.Fields If oField.Type = wdFieldIncludePicture Then With oField.Result.InlineShapes(1) dFactor = .Height / .Width .Width = CentimetersToPoints(cNewWidth) .Height = dFactor * .Width End With End If Next End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
"Result" that's it
Thanks Paul NP |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using IncludePicture and MailMerge to insert picture | Elena | Mail Merge | 25 | 02-06-2022 05:35 PM |
IncludePicture does not refresh the pictures | ragesz | Mail Merge | 5 | 10-23-2020 03:41 AM |
IncludePicture does not work in Mailmerge | malalex | Mail Merge | 4 | 12-10-2013 07:09 PM |
INCLUDEPICTURE with Mail Merge - showing same image on every document | ccordner | Word | 0 | 10-23-2013 06:42 AM |
Selection of all Text for a specific page in word is spanning selection across pages | ramsgarla | Word VBA | 9 | 12-05-2012 03:23 AM |