VBA: Default file location

H

Howard Kaikow

Is there a means in PowerPoint VBA to determine the default file save
location?
Better yet, is there a means to change that default location?
 
S

Steve Rindsberg

Is there a means in PowerPoint VBA to determine the default file save
location?
Better yet, is there a means to change that default location?

Hmm. Y'know I don't think I've ever messed with this.
You set it manually using Tools, Options, Save tab.
Most of the settings you make there get saved to the registry, down in HKCU
Software/Microsoft/Officexx/Powerpoint/Options or words to that effect.

Try setting the default save manually to some oddly named directory then have a
look in that section of the reg for the same directory name.

Setting it via VBA is another matter. PPT reads this section of the reg at
startup, writes back to it as you change things manually but never re-reads it
until the next session, meaning that you can't write to it while PPT's open and
affect anything.

If you're automating PPT from another app, you can write to the registry then
fire off PPT, no worries.

From w/in PPT, you'd need to use SendKeys to change the settings. Ugh.
 
H

Howard Kaikow

Steve Rindsberg said:
If you're automating PPT from another app, you can write to the registry then
fire off PPT, no worries.

All I want to do is access the value so my VB 6 app can plop things in te
default directory.
From w/in PPT, you'd need to use SendKeys to change the settings. Ugh.

A ha!

No need to use SendKeys.

Over the past few weeks, I've been investigating how to avoid using SendKeys
to set the Password in Project Properties dialog. This was a very, ..., very
difficult task

I succeeded in doing this a day or so ago.

I have since come up with common code that works with Access, Excel,
Powerpernt and Word. Will likely also work with Outlook and other Office VBA
apps. I don't have Front Page 20003, but I could check whether the code
works in Front Page 2002

Whilst setting the password may not be important, as it is easily bypassed,
the techniques I used may be applied to work with other dialogs without
using SendKeys.

I will be posting the code at my web site in the not too distant future,
perhaps as early as this weekend.
 
S

Steve Rindsberg

All I want to do is access the value so my VB 6 app can plop things in te
default directory.

See if this works:

HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\PowerPoint\RecentFolderList

Under that, Default, RegExpandSZ = \-terminated path to the folder you want.

Seems to set the default open and save directory here (Office 2000)

No need to use SendKeys.

Ever considered a career as a deity? ;-)

I will be posting the code at my web site in the not too distant future,
perhaps as early as this weekend.

If you happen by again, post a note here when it gets up; otherwise, I'll see
it in one of the other Office dev areas, I'm sure. Thanks!
 
H

Howard Kaikow

Might be a delay in posting to my web site, Access 97 is not co-operating
with code that works on Access 2000 and later.
 
S

Steve Rindsberg

Might be a delay in posting to my web site, Access 97 is not co-operating
with code that works on Access 2000 and later.

No problem. When you're ready, we'll be waiting. ,-)
 

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