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

x
?
Solved

VBA Script to Convert all Images from eps to jpg or png

Posted on 2010-11-18
1
Medium Priority
?
2,035 Views
Last Modified: 2012-05-10
Hi,

My company has a few hundred word documents with eps images in them. Recently we became aware that these documents do not work correctly in Word 2008 for mac, because of an updated EPS filter or similar causing the images to be displayed improperly. I am looking for a VBA Script to read the document and convert the EPS files to a different format like JPG, PNG, or even WMF I guess, so that Word 2008 on mac can use these documents.

I am open to using other languages to perform this task as well, I just figured that VBA would be better suited to it as it is built into the office suite.

The documents were created in Word 2003
0
Comment
Question by:jrm213jrm213
[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
1 Comment
 
LVL 17

Accepted Solution

by:
jrm213jrm213 earned 0 total points
ID: 34167435
Ok, well I was able to write a script to accomplish this in an acceptable manner so that Word 2008 for Mac can now properly open and print these files. I just have to run this script on each document.

You probably don't need the IconLabel or the i variable, I was just using them to count how many items I replaced to make sure it got all the images.
Dim oIshp As InlineShape
  Dim oshp As Shape
  Dim i As Integer
  
  i = 0
    For Each oshp In ActiveDocument.Shapes     
        With oshp
            If (oshp.Type = 11) Then
            i = i + 1
                oshp.Select
                ActiveWindow.Selection.CopyAsPicture
                ActiveWindow.Selection.Range.PasteSpecial datatype:=wdPasteEnhancedMetafile, IconLabel:="moved" + Str(i)
                ActiveDocument.Shapes(ActiveDocument.Shapes.Count).Top = oshp.Top
                ActiveDocument.Shapes(ActiveDocument.Shapes.Count).Left = oshp.Left
                oshp.Delete
            End If
            
           
        End With
    Next oshp

Open in new window

0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
Suggested Courses

609 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