| Author |
Accessing PowerPoint CustomDocumentProperties from VB
|
|
| JohnBury 2006-07-03, 6:56 pm |
| Hi
I am a teacher writing some code to help my colleagues create a library of
lesson plans with integrated PowerPoint resources. As part of my development
I would like to be able to set and retrieve values from
CustomeDocumentProperties in a PowerPoint presentation.
I have checked out the documentation (pretty scant!) and trawled the
internet for other links / ideas.
My project has references to Powerpoint 11 and Office 11
I have tried
oPPT_Pres.CustomDocumentProperties("YearGroup").Value
to retrieve and set the value and get an error message every time.
Is there a simple explanation as to why I have been unable to fathom this
apparently simple problem?
Look forward to your assistance
--
UK John (Science Teacher!!)
| |
| Bob Butler 2006-07-03, 6:56 pm |
| "JohnBury" <JohnBury@discussions.microsoft.com> wrote in message
news:97199CBB-4FCE-44DE-A94D-03D7A2681EC0@microsoft.com
> Hi
>
> I am a teacher writing some code to help my colleagues create a
> library of lesson plans with integrated PowerPoint resources. As
> part of my development I would like to be able to set and retrieve
> values from CustomeDocumentProperties in a PowerPoint presentation.
>
> I have checked out the documentation (pretty scant!) and trawled the
> internet for other links / ideas.
>
> My project has references to Powerpoint 11 and Office 11
>
> I have tried
>
> oPPT_Pres.CustomDocumentProperties("YearGroup").Value
>
> to retrieve and set the value and get an error message every time.
>
> Is there a simple explanation as to why I have been unable to fathom
> this apparently simple problem?
What error are you getting?
One of the best ways to figure it out is to open PPT and start recording a
macro, then walk through adding a new custom property and changing the value
and then stop recording and look at the code it generated. It's not always
the cleanest code but it usually at least shows the correct properties and
methods to use and sequence to follow.
--
Reply to the group so all can participate
VB.Net: "Fool me once..."
| |
| JohnBury 2006-07-03, 6:56 pm |
| Bob
Thanks for the idea! Don't know why I didn't think of it, its a technique I
often use, but it didn't occur to me this time!
Again, Many thanks!
Regards
--
UK John
"Bob Butler" wrote:
> "JohnBury" <JohnBury@discussions.microsoft.com> wrote in message
> news:97199CBB-4FCE-44DE-A94D-03D7A2681EC0@microsoft.com
>
> What error are you getting?
>
> One of the best ways to figure it out is to open PPT and start recording a
> macro, then walk through adding a new custom property and changing the value
> and then stop recording and look at the code it generated. It's not always
> the cleanest code but it usually at least shows the correct properties and
> methods to use and sequence to follow.
>
> --
> Reply to the group so all can participate
> VB.Net: "Fool me once..."
>
>
| |
| JohnBury 2006-07-03, 6:56 pm |
| Oops forgot to add this part!
Just in case anyone else wants to do this in PowerPoint (or any other Office
app (I think!), it seems you cannot modify the value of a custom property,
you have to delete and then add it again with the new value!
--
UK John
"Bob Butler" wrote:
> "JohnBury" <JohnBury@discussions.microsoft.com> wrote in message
> news:97199CBB-4FCE-44DE-A94D-03D7A2681EC0@microsoft.com
>
> What error are you getting?
>
> One of the best ways to figure it out is to open PPT and start recording a
> macro, then walk through adding a new custom property and changing the value
> and then stop recording and look at the code it generated. It's not always
> the cleanest code but it usually at least shows the correct properties and
> methods to use and sequence to follow.
>
> --
> Reply to the group so all can participate
> VB.Net: "Fool me once..."
>
>
| |
| Larry Serflaten 2006-07-03, 6:56 pm |
|
"JohnBury" <JohnBury@discussions.microsoft.com> wrote
> Oops forgot to add this part!
>
> Just in case anyone else wants to do this in PowerPoint (or any other Office
> app (I think!), it seems you cannot modify the value of a custom property,
> you have to delete and then add it again with the new value!
That sounds suspiciously like the response of a Collection object....
LFS
| |
| Bob Butler 2006-07-03, 6:56 pm |
| "JohnBury" <JohnBury@discussions.microsoft.com> wrote in message
news:6998C4E0-990A-4CE5-955B-A7775BAD043A@microsoft.com
> Oops forgot to add this part!
>
> Just in case anyone else wants to do this in PowerPoint (or any other
> Office app (I think!), it seems you cannot modify the value of a
> custom property, you have to delete and then add it again with the
> new value!
I noticed that it did it that way but it also seemed to let me modify it
directly -- that's why I asked what error you were getting. It might be
version dependent with the macro recorder erring on the safe side.
--
Reply to the group so all can participate
VB.Net: "Fool me once..."
|
|
|
|