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

How to Add Notes to PPT Slide using Macro to Export Object

Currently, I have a dashboard with several line, pivot, pie charts.

I've developed a vbscript macro to export all of these as images to powerpoint.

I'd like to add notes (and/or) comments to each powerpoint slide using the vbscript macro in order to describe each chart.

I've attached an image for clarification if needed.

Does anyone know how this can be done?

Thanks

3 Replies
Not applicable
Author

yes it is posiible through macro

Gysbert_Wassenaar

I'm sure it can be done. You'll have to find some code to add the notes. Here's a vba example. It shouldn't be too hard to adapt this to vbscript.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Thank you for you reply.

Can you offer any guidance regarding how to adapt to vbscript?

I haven't been able to get it correct yet.

Here is my script....

sub ppt

on error resume next

'vPPTTemplatePath = "C:\Template.pptx"

set PPApp = CreateObject("Powerpoint.Application")

          PPApp.Visible = True 

'Set PPPres = PPApp.Presentations.Open(vPPTTemplatePath, -1)

set PPPres = PPApp.Presentations.Add

PPSlideNo=1

'------------ Slide 1 -----------------------------

set PPSlide = PPPres.Slides.Add(PPSlideNo, 1)

          ActiveDocument.Sheets("Pie").Activate

          ActiveDocument.GetApplication.WaitForIdle

          ActiveDocument.GetSheetObject("CH01").CopyBitmapToClipboard

          PPSlide.Shapes.Paste

set Shape1 = PPSlide.Shapes(1)

                    Shape1.LockAspectRatio = msoTrue

                    Shape1.NotesPage.Shapes.Placeholders[2].TextFrame.TextRange.InsertAfter("This is a test comment.")

          With Shape1

.LockAspectRatio = msoTrue

'.Height = 500

'.Width = 800

.Left = 50

.Top = 0

.TextFrame.TextRange.Text = "Test Comment"

          end with

                    Shape1.Left = (.SlideWidth \ 2) - (Shape1.Width \ 2)

                    Shape1.Top = (.SlideHeight \ 2) - (Shape1.Height \ 2)'100

'                    Shape1.Align mso

                    ActiveDocument.GetApplication.WaitForIdle

end sub