arif hussain
arif hussain

Reputation: 3

is there any way that i can convert EPS file to EMF enhanced meta file into slide using VBA

i was trying to figure out a way using external libraries to do the job, using Imagemagick.



Sub ConvertEPS()
  Declare variables for the file paths
  Dim epsFile As String
  Dim pngFile As String

  ' Set the file paths
  epsFile = "F:\123.eps"
  pngFile = "F:\xyz.png"

  ' Call ImageMagick to convert the EPS file to PNG
  Shell "convert.exe " & epsFile & " " & pngFile, vbHide

  ' Insert the PNG image into the active slide
  ActivePresentation.Slides(1).Shapes.AddPicture(pngFile, msoFalse, msoTrue, 0, 0).Select

  ' Clean up by deleting the PNG file
  Kill pngFile

End Sub

Upvotes: 0

Views: 239

Answers (0)

Related Questions