ok, I did for myself, here you are
these are single modules, put them in a wider loop or use as you like it (and forgive my english ...)
*export from jmp - image
generate your graph as usual, creating a reference to it (for example
graph_reference = datatable <<Chart( X( :week, :class ) etc
then save the image as usual
graph_reference <<Save Picture("\output\"name_image.png", png);
*export from jmp - text
just for test put something in your variables, the real use will be to have them contain the info you need to export
string_containing_title1 = "first row";
string_containing_title2 = "\!Nsecond row";
Save Text File("titles.txt",string_containing_title1, mode ("replace"));
Save Text File("titles.txt",string_containing_title2, mode ("append"));
and now that you have images and text, you can import them directly in powerpoint (pay attention to the format .pptm, macros security and that stuff ...)
this is the VBA code that import an image and place it
' definition variables slides
Dim oSlide As Slide
Dim numero As Integer
Dim oPicture As Shape
' definition variables images
Dim ImgFolder As String: ImgFolder = "C:\Users\john_ronald_reuel\Documents\toy_box\pet01\test_im\"
Dim piazza1 As String
Dim file1 As String
' value set for testing purposes, for real use put up a cicle to define them, here we put 5831_pie.jpg in slide 02
file1 = "5831_pie.jpg"
numero = 2
' creating full path for image files
piazza1 = (ImgFolder & file1)
' setting slide 02 as active
Set oSlide = ActiveWindow.Presentation.Slides(numero)
' place image, no link, with save, at coordinates 10,10 from top left, no rescale
Set oPicture = oSlide.Shapes.AddPicture(piazza1, msoFalse, msoTrue, 10, 10)
' editing: use crop and others to cropt, place or rescale.
With ActivePresentation.PageSetup
oPicture.PictureFormat.CropBottom = 30
oPicture.Height = 450
oPicture.Left = 450
End With
notes to this:
*you can use relative path with this code --> ImgFolder = ActivePresentation.Path & "\output\"
*the image editing is sequential and does not like negative numbers: if you want to crop 40 and end at 10, cannot start at -30 and crop and stop, but have to start at 10, crop and then after use left (or top)
*piazza and numero are used to make the code not hardwired, but this is a single module. you better use a cicle and an array to store image names and slide numbers
and here is the code to load the info exported from jmp and put them in an array, each row goes to an element of the array
'definition variables for cicle
Dim ilivelli As Integer
Dim i As Integer
Dim temp As String
'definition variables for text file
Dim indexfolder As String
Dim ImgFolder As String
Dim sFileName As String
Dim iFileNum As Integer
'definition folder
indexfolder = "C:\Users\john_ronald_reuel\Documents\toy_box\pet01\config\"
'definition dynamic array, will contain the rows of the text file
Dim sparam() As String
'redimension it large
ReDim sparam(75) As String
'define file name
sFileName = indexfolder & "levels_DD.txt"
'load the file
iFileNum = FreeFile()
Open sFileName For Input As iFileNum
'cicle do EOF: load line i-eth, put it in temp, then assign it ti the i-eth element of the array, then update the integer ilivelli
i = 1
Do While Not EOF(iFileNum)
Line Input #iFileNum, temp
sparam(i) = CStr(temp)
ilivelli = i
i = i + 1
Loop
'redimension the array to the correct number of row, without erasing it
ReDim Preserve sparam(ilivelli)
'close the original file
Close iFileNum
this is working for me, i hope it helps!