I am trying to generate a few hundred basic graphics where the shape text and background color is based on a text string.
For this i have chosen to use PowerPoint, because i feel that the image styling is quite comprehensive for my function. The only program that i know how to do this is Adobe Photoshop, however i do not have that software.
I have got the export image function to work, however the image quality of the exported graphic is terrible
How could i get this done with a better image processor?
As can be seen, i have a powerpoint slide with a textbox to hold the stringvalues (Rectangle 5) and my “shape” which will be styled by the two RGB values in the text string.
the string value has the following format (pipe delimited)
- Textbox 4.Name | Rounded Rectangle 7.Color | Rounded Rectangle 3.Color

Code used:
Private Sub btnProcess_Click()
Dim i As Integer
Dim StringsArray As Variant
Dim StringItems As Variant
' Call getlines to break all lines into separate records in stringsarray
StringsArray = getlines()
For i = 0 To UBound(StringsArray)
StringItems = Split(StringsArray(i), "|")
ActivePresentation.Slides("Slide1").Shapes("TextBox 4").TextFrame.TextRange.Text = StringItems(0)
ActivePresentation.Slides("Slide1").Shapes("Rounded Rectangle 7").Fill.ForeColor.RGB = StringItems(1)
ActivePresentation.Slides("Slide1").Shapes("Rounded Rectangle 3").Fill.ForeColor.RGB = StringItems(2)
ActivePresentation.Slides("Slide1").Shapes("Group 6").Export "C:\temp\file.emf", ppShapeFormatEMF, 150, 150, ppRelativeToSlide
Next i
End Sub
Function getlines() As Variant
Dim mylines As Variant
Dim mytext As String
mytext = ActivePresentation.Slides("Slide1").Shapes("Rectangle 5").TextFrame.TextRange.Text
mylines = Split(mytext, vbCr)
getlines = mylines
End Function
The vector graphics based PPT object as seen on the PowerPoint slide is not affected by the scale so at all zoom level the object will not appear distorted.
I could not find a way to output the object graphic as a true Metafile even the ppShapeFormatEMF format does not generate a vector based EMF, just a much larger image.
My best solution at the end, was to increase the base size of the PPT object and export the shape object using the ppShapeFormatPNG format thereby increasing the level of detail of the image.
Kinda Obvious.