Solved

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

Posted on 2016-09-02
6
48 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 48

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 48

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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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 48

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now