I have开发者_开发问答 been using VB to manipulate notes in PowerPoint presentations.
Until today, everything had been working fine (in PowerPoint 2007) using:
strReturn = myPres.Slides(commandeObject.slide).NotesPage.Shapes(2).TextFrame.TextRange.Text
But today I tried the code on a PowerPoint 2003 presentation and it threw an error saying that the object didn't exist.
I tried looking in shape 1 and 0, but I don't find the notes.
I then tried updating the presentation to the 2007 format, but the notes are still not accessible using VB, although they appear in the PowerPoint window fine.
Any suggestions on how I could find the notes in older presentations would be really helpful - I have lots of old presentations and it would take ages to rewrite them all...
Cheers,
Dave
I tried simliar code opening an old PowerPoint 2003 document that I confirmed had notes in it, and your code worked fine. What is the "commandeObject.slide" reference? I'm wondering if that is the problem?
Perhaps you could try something slightly different like this to loop through all the slides in the deck? This worked for me.
For Each s as Microsoft.Office.Interop.PowerPoint.Slide In myPres.Slides
Console.WriteLine(s.NotesPage.Shapes(2).TextFrame.TextRange.Text)
Next
精彩评论