Default file location in VBA?

C

c mateland

Hello.

1) In VBA, how can I capture the "Default File Location" on the user's
machine?

It's simple to do in Excel (DefaultFilePath), but I can't find an
object or method in PPT, and I've read as much archives as I could
find.

2) Then how can I include code to change the current path to that
location after I open an existing file in that code?

I've tried the common tactic of
ChDrive "C"
ChDir "C:\Documents and Settings\Chuck\My Documents"
but it doesn't seem to work in PPT.

What I've got is I made an addin that opens a file upon PPT launch,
which unfortunately changes the current path to that file. I want it
changed back to the original default file location the user had set.

3) If nothing exists to do this, is there a way to first read the
location of the the default file that typically opens upon PPT launch?
But that can be tricky since the addin, via AutoOpen, opens a file and
I think it then prevents the default blank file from opening. Right?

4) Any other ideas to capture and restore the default file location?

Thanks,
Chuck
 
C

c mateland

Yikes, that sounds complex. I don't know how to capture such a setting
value with code.

Instead, I'm testing this approach: I'll change the file-open code to
include Untitled=True. In brief tests, that left the default file
location alone. It sort of opens the file as a template, which is what
it's used as anyway. How does that sound?

-Chuck
 

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