<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Updating picture links in a PowerPoint document using JSL and VBA in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Updating-picture-links-in-a-PowerPoint-document-using-JSL-and/m-p/298588#M55867</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5241"&gt;@johnmoore&lt;/a&gt;, I faced something similar, I know the difficulty to keep updating packages using corporate templates in power point and need to update about 300 images from Anova, variability charts, Cpk reports, etc created in JMP where every power point package contains "basically the same charts", always in the same place, the only difference is the raw data needed for the specific report.&lt;/P&gt;&lt;P&gt;I am not really expert in VBA, but when you need something, you keep searching every where and do trial and error until you can make/find a solution.&lt;/P&gt;&lt;P&gt;This is the approach I follow, maybe you have something similar so far:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In JMP send through JSL your analysis (images) to a folder in your PC and assign a specific name to each image (never name them same because then only will overwrite). Once you customize in power point the location of each specific image and make the link for each of them.save it&amp;nbsp; as a macro file (this will be your template).&lt;/LI&gt;&lt;LI&gt;Open your template and Run the macro any time you need a new report.&lt;/LI&gt;&lt;LI&gt;Finally save the file as no macro and with a different name to keep the template with images ready for next time.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Hope this can help you, I strongly recommend you to put password to the macro to avoid changes in the script.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub LinkedGraphsToPictures()&lt;BR /&gt;'Created by Andres Gonzalez, March 2019&lt;BR /&gt;'Purpose: Change linked graphs into regular images&lt;/P&gt;&lt;P&gt;Dim shp As Shape&lt;BR /&gt;Dim sld As Slide&lt;BR /&gt;Dim pic As Shape&lt;BR /&gt;Dim shp_left As Double&lt;BR /&gt;Dim shp_top As Double&lt;BR /&gt;Dim sld_count As Long&lt;/P&gt;&lt;P&gt;'Loop Through Each Slide in ActivePresentation&lt;BR /&gt;For Each sld In ActivePresentation.Slides&lt;BR /&gt;For sld_count = ActivePresentation.Slides.Count To 1 Step -1&lt;BR /&gt;' Count to -1 to countbackward in order to avoid skipping charts due to chart deleted&lt;BR /&gt;Set sld = ActivePresentation.Slides(sld_count)&lt;BR /&gt;For Each shp In sld.Shapes&lt;BR /&gt;&lt;BR /&gt;If shp.Type = msoLinkedPicture Then&lt;BR /&gt;'Retrieve current positioning&lt;BR /&gt;shp_left = shp.Left&lt;BR /&gt;shp_top = shp.Top&lt;BR /&gt;&lt;BR /&gt;'Copy/Paste as Picture&lt;BR /&gt;shp.Copy&lt;BR /&gt;&lt;BR /&gt;sld.Shapes.PasteSpecial DataType:=ppPastePNG&lt;BR /&gt;Set pic = sld.Shapes(sld.Shapes.Count)&lt;BR /&gt;&lt;BR /&gt;'Delete Linked Shape&lt;BR /&gt;shp.Delete&lt;BR /&gt;&lt;BR /&gt;'Reposition newly pasted picture&lt;BR /&gt;pic.Left = shp_left&lt;BR /&gt;pic.Top = shp_top&lt;BR /&gt;&lt;BR /&gt;End If&lt;BR /&gt;Next shp&lt;BR /&gt;Next sld_count&lt;BR /&gt;Next sld&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Sep 2020 14:10:37 GMT</pubDate>
    <dc:creator>AndresGlez</dc:creator>
    <dc:date>2020-09-03T14:10:37Z</dc:date>
    <item>
      <title>Updating picture links in a PowerPoint document using JSL and VBA</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-picture-links-in-a-PowerPoint-document-using-JSL-and/m-p/287986#M55526</link>
      <description>&lt;P&gt;I am working on an add-in to automate some reporting.&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;There is a report template PowerPoint file that includes links to image files of various charts and tables. (see attched)&lt;/LI&gt;&lt;LI&gt;When the user clicks the "add to active report" button, the appropriate image file will be overwritten so that the new chart or table will show up in the report.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The problem I am having is that I need to update the links in the PowerPoint document.&amp;nbsp; I would like to be able to say "create new report", copy the template and default images into a new folder, and update the links in the the new PowerPoint file so that the point to the image files in the new folder instead of the image files in the template folder.&amp;nbsp; Any ideas how I might do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:35:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-picture-links-in-a-PowerPoint-document-using-JSL-and/m-p/287986#M55526</guid>
      <dc:creator>johnmoore</dc:creator>
      <dc:date>2023-06-09T23:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Updating picture links in a PowerPoint document using JSL and VBA</title>
      <link>https://community.jmp.com/t5/Discussions/Updating-picture-links-in-a-PowerPoint-document-using-JSL-and/m-p/298588#M55867</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5241"&gt;@johnmoore&lt;/a&gt;, I faced something similar, I know the difficulty to keep updating packages using corporate templates in power point and need to update about 300 images from Anova, variability charts, Cpk reports, etc created in JMP where every power point package contains "basically the same charts", always in the same place, the only difference is the raw data needed for the specific report.&lt;/P&gt;&lt;P&gt;I am not really expert in VBA, but when you need something, you keep searching every where and do trial and error until you can make/find a solution.&lt;/P&gt;&lt;P&gt;This is the approach I follow, maybe you have something similar so far:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In JMP send through JSL your analysis (images) to a folder in your PC and assign a specific name to each image (never name them same because then only will overwrite). Once you customize in power point the location of each specific image and make the link for each of them.save it&amp;nbsp; as a macro file (this will be your template).&lt;/LI&gt;&lt;LI&gt;Open your template and Run the macro any time you need a new report.&lt;/LI&gt;&lt;LI&gt;Finally save the file as no macro and with a different name to keep the template with images ready for next time.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Hope this can help you, I strongly recommend you to put password to the macro to avoid changes in the script.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub LinkedGraphsToPictures()&lt;BR /&gt;'Created by Andres Gonzalez, March 2019&lt;BR /&gt;'Purpose: Change linked graphs into regular images&lt;/P&gt;&lt;P&gt;Dim shp As Shape&lt;BR /&gt;Dim sld As Slide&lt;BR /&gt;Dim pic As Shape&lt;BR /&gt;Dim shp_left As Double&lt;BR /&gt;Dim shp_top As Double&lt;BR /&gt;Dim sld_count As Long&lt;/P&gt;&lt;P&gt;'Loop Through Each Slide in ActivePresentation&lt;BR /&gt;For Each sld In ActivePresentation.Slides&lt;BR /&gt;For sld_count = ActivePresentation.Slides.Count To 1 Step -1&lt;BR /&gt;' Count to -1 to countbackward in order to avoid skipping charts due to chart deleted&lt;BR /&gt;Set sld = ActivePresentation.Slides(sld_count)&lt;BR /&gt;For Each shp In sld.Shapes&lt;BR /&gt;&lt;BR /&gt;If shp.Type = msoLinkedPicture Then&lt;BR /&gt;'Retrieve current positioning&lt;BR /&gt;shp_left = shp.Left&lt;BR /&gt;shp_top = shp.Top&lt;BR /&gt;&lt;BR /&gt;'Copy/Paste as Picture&lt;BR /&gt;shp.Copy&lt;BR /&gt;&lt;BR /&gt;sld.Shapes.PasteSpecial DataType:=ppPastePNG&lt;BR /&gt;Set pic = sld.Shapes(sld.Shapes.Count)&lt;BR /&gt;&lt;BR /&gt;'Delete Linked Shape&lt;BR /&gt;shp.Delete&lt;BR /&gt;&lt;BR /&gt;'Reposition newly pasted picture&lt;BR /&gt;pic.Left = shp_left&lt;BR /&gt;pic.Top = shp_top&lt;BR /&gt;&lt;BR /&gt;End If&lt;BR /&gt;Next shp&lt;BR /&gt;Next sld_count&lt;BR /&gt;Next sld&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 14:10:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Updating-picture-links-in-a-PowerPoint-document-using-JSL-and/m-p/298588#M55867</guid>
      <dc:creator>AndresGlez</dc:creator>
      <dc:date>2020-09-03T14:10:37Z</dc:date>
    </item>
  </channel>
</rss>

