Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Resize images within a Word document

Posted on 2004-08-17
2
Medium Priority
?
211 Views
Last Modified: 2011-09-20
I'm trying to write a VB program that will open a Word document and resize all the images contained within.  This document may have as many as 20 images.  I have tried the following with little success. The first image resizes but the remaining images do not.

   Dim objWordApp As New Word.Application
   Dim objWordDoc As New Word.Document
   
   Set objWordDoc = objWordApp.Documents.Add("WordDocument.doc")

   ' Loop through the images
   For cnt = 0 To (objWordDoc.InlineShapes.Count - 1)
      objWordDoc.InlineShapes(cnt).Width = 250
      objWordDoc.InlineShapes(cnt).Height = 250
   Next

   objWordDoc.Save
0
Comment
Question by:TheChos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
JR2003 earned 2000 total points
ID: 11823532
Dim iShape As InlineShape
For Each iShape In ActiveDocument.InlineShapes
    iShape.Width = 250
    iShape.Height = 250
Next iShape
0
 

Author Comment

by:TheChos
ID: 11823617
Excellent!

It's very obvious after reading your solution.  I can't believe I didn't think of it.  Thanks again.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

618 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