Solved

How can i reset all images size to default in a word file

Posted on 2016-09-02
6
74 Views
Last Modified: 2016-09-27
How can i reset all images size to default in a word file
I have many word files and all images and reduced from its original size. How can i reset them to the original size in one go?

thanks
0
Comment
Question by:mtthompsons
  • 3
  • 2
6 Comments
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 41781586
Hi,

pls try
Sub macro()
For Each shp In ActiveDocument.InlineShapes
    If shp.Type = wdInlineShapePicture Then
        shp.LockAspectRatio = msoFalse
        sclH = shp.ScaleHeight
        SclW = shp.ScaleWidth
        shp.Height = shp.Height * 100 / sclH
        shp.Width = shp.Width * 100 / SclW
    End If
Next
End Sub

Open in new window

Regards
0
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 41781619
augmented code
Sub macro()
For Each shp In ActiveDocument.InlineShapes
    If shp.Type = wdInlineShapePicture Then
        shp.LockAspectRatio = msoFalse
        sclH = shp.ScaleHeight
        SclW = shp.ScaleWidth
        shp.Height = shp.Height * 100 / sclH
        shp.Width = shp.Width * 100 / SclW
    End If
Next
For Each shp In ActiveDocument.Shapes
    If shp.Type = msoPicture Then
        shp.LockAspectRatio = msoFalse
        shp.ScaleHeight 1, True
        shp.ScaleWidth 1, True
    End If
Next
End Sub

Open in new window

Regards
0
 
LVL 6

Expert Comment

by:Wayne Herbert
ID: 41781991
DO you want the images to still be contained in the Word files or are you looking for full size images only?
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 

Author Comment

by:mtthompsons
ID: 41782948
Thanks i get the attached error

Yes images have to be in the file just need to resize them inside the word file
0
 

Author Comment

by:mtthompsons
ID: 41782949
0
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41783625
then try

Sub macro()
For Each shp In ActiveDocument.InlineShapes
    If shp.Type = wdInlineShapePicture Then
        shp.LockAspectRatio = msoFalse
        shp.ScaleHeight = 100
        shp.ScaleWidth = 100
    End If
Next
For Each shp In ActiveDocument.Shapes
    If shp.Type = msoPicture Then
        shp.LockAspectRatio = msoFalse
        shp.ScaleHeight 1, True
        shp.ScaleWidth 1, True
    End If
Next
End Sub

Open in new window

0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA taking too long 5 24
Selecting Right Partition 6 71
Save and close already open Excel file using VBscript 9 52
IDE for Python 5 26
This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question