Reputation: 3
iam trying to figure out a way to get it done, but was getting error saying Unable to import file . seems the device epspdf is not available in ghost script current version. is there any work-around so that i can import the EPS file into slide, basically ungroup it as EMF format into Slide using VBA code,
Sub ConvertEPS()
'Declare variables for the file paths
Dim epsFile As String
Dim pngFile As String
' Set the file paths
epsFile = InputBox("Enter File path with name in A:\B\C.eps format ", "Convert EPS")
pngFile = InputBox("Similarly enter Path to save EMF ", "Temp")
' Call GS to convert the EPS file to PNG
Shell "gswin64c -sDEVICE=epspdf -o " & emfFile & " " & epsFile, vbHide
' Insert the emf image into the active slide
ActivePresentation.Slides(1).Shapes.AddPicture emfFile, msoFalse, msoTrue, 0, 0
' Clean up by deleting the PNG file
Kill pngFile
End Sub```
Upvotes: 0
Views: 88