Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Export text object together with each caption to PPT using Macro

Hi Experts

Is there any way to export captions of text objects to PPT using Macro?

This is what I want to do.

This is a current result

I am using below  VB Script. It works ok but No captions.

Sub ExportPPT

Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True
Set objPresentation = objPPT.Presentations.Add

    For i = 0 To ActiveDocument.NoOfSheets - 3
        Set MySheet = ActiveDocument.GetSheet(i)

        Set PPSlide = objPresentation.Slides.Add(1,12)
        ActiveDocument.ActiveSheet.CopyBitmapToClipboard

ActiveDocument.GetSheetObject("TX01").CopyBitmapToClipboard 

objPPT.Visible = True

        PPSlide.Shapes.Paste()
                   
    Next

Set PPSlide = Nothing
Set PPPres = Nothing

End sub

Thanks,

Kiyomi

3 Replies
Miguel_Angel_Baeyens

Check this thread for a very similar request:Export to Excel‌. While the original poster requested excel, the issue with the caption is covered with the lines

chartCaption = tableToExport.GetCaption.Name.v

You will need to adapt the macro code to your own objects or charts.

Anonymous
Not applicable
Author

Hi Miguel

Thank you for replying.

Is this script only for Excel?

I tried it but not succeeded.

  1.   'Get the chart we want to export 
  2.      Set tableToExport = ActiveDocument.GetSheetObject("CH01") 
  3.      Set chartProperties = tableToExport.GetProperties 
  4.      tableToExport.CopyTableToClipboard true 
  5.  
  6.      'Get the caption 
  7.      chartCaption = tableToExport.GetCaption.Name.v 
  8.      'MsgBox chartCaption 

Where should I change this script?

Thank you

Kiyomi

Miguel_Angel_Baeyens

Yes, the code as I mentioned above is only for Excel (see the name of the post and the code) and you will need to recreate it for PowerPoint. I cannot tell you from memory how it will look like but I'm sure there are some powerpoint examples in the Community you can search for and use along with mine to set up yours