Macro to resize and center align pictures, charts, canvas in MS Word document

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hey people,

I am novice to word VBA programming.

I have a word document and it contains, pictures, charts and canvas
(powerpoint slides).
Currently, I use the following code to center align the pictures and
charts.

Sub test()
Dim dc As Document
Dim ilShp As InlineShape

Set dc = ActiveDocument

For Each ilShp In dc.InlineShapes
If Not ilShp.Type = wdInlineShapeOLEControlObject Then
ilShp.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
End If
Next

End Sub

I trying to write macros to:
1. Center align a canvas
2. Strecth/resize a picture to fit the width of the page while
mainitaing the aspect ratio.

Please let me know the macro for those.

I would really appreciate any help. Thank You.
.



Relevant Pages

  • Re: Macro to resize and center align pictures, charts, canvas in MS Word document
    ... I have a word document and it contains, pictures, charts and canvas ...
    (microsoft.public.word.vba.general)
  • Re: Grouping pictures in Word 2007
    ... need to 'paste' into the canvas is larger than the canvas then the canvas ... has flat square sizing handles (old/classic graphics engine object) or with other 'white pearl handled' items. ... Because of that partial implementation, the inserted pictures and SmartArt are managed by the new Office graphics engine, while the ... Work within a Word drawing Canvas: ...
    (microsoft.public.word.drawing.graphics)
  • Re: Grouping pictures in Word 2007
    ... need to 'paste' into the canvas is larger than the canvas then the canvas ... has flat square sizing handles (old/classic graphics engine object) or with other 'white pearl handled' items. ... Because of that partial implementation, the inserted pictures and SmartArt are managed by the new Office graphics engine, while the ... Work within a Word drawing Canvas: ...
    (microsoft.public.word.drawing.graphics)
  • Re: Grouping pictures in Word 2007
    ... need to 'paste' into the canvas is larger than the canvas then the canvas ... has flat square sizing handles (old/classic graphics engine object) or with other 'white pearl handled' items. ... Because of that partial implementation, the inserted pictures and SmartArt are managed by the new Office graphics engine, while the ... Work within a Word drawing Canvas: ...
    (microsoft.public.word.drawing.graphics)
  • Re: Grouping pictures in Word 2007
    ... has flat square sizing handles (old/classic graphics engine object) or with other 'white pearl handled' items. ... Because of that partial implementation, the inserted pictures and SmartArt are managed by the new Office graphics engine, while the ... Work within a Word drawing Canvas: ...
    (microsoft.public.word.drawing.graphics)