customdocumentproperties in add-in via vba

M

Matt Miller

Greetings,

Is there a way to access customdocumentproperties in a powerpoint add-in
from vba running in that add-in? I want to allow the users to maintain there
own default settings, so I plan to save them as customdocumentproperties. In
a ppt file, this works great, but I'll be distributing it as an add-in.

Or, is there a better way I should be handling this? I suppose I could use
writeprivateprofilestring to stash the info the registry, but that seems like
overkill. I'd prefer to keep it all self-contained, if possible, so if the
add-in is removed nothing is left behind.
 
M

Matt Miller

Steve Rindsberg said:
CustomDocumentProperties are part of presentations and are accessible from VBA
addins but it sounds as though you want to store settings in the addin itself or
somehow make the settings accessible globally to the user, not tied to a
particular presentation?

Exactly. The settings I want to store control how the add-in functions, so
they need to be independent of any particular presentation upon which the
add-in is working. When a presentation is saved as an add-in, are the
customdocumentproperties still available via vba? If so, how? I haven't been
able to find a way for vba in an add-in to refer to the add-in itself as a
presentation, so I can't get to the properties. In Word, for example, you can
use macrocontainer to refer to the template being run as an add-in and get to
the customdocumentproperties.
WritePrivateProfileString writes to an INI file, not to the registry.
And at that, not a bad way to handle things, since you can always write to the
same folder as the addin itself. Delete both and you're back to a clean
machine, more or less.

Oops, good point. I was thinking of privateprofilestring in Word, which lets
to get to the registry also. If I don't find a way to maintain the settings
in the ppa file itself, I'll probably go with the ini file approach.

Peace,
-Matt
 
M

Matt Miller

Thanks. At least I know I wasn't missing anything obvious or simple. INI it
is...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top