Consulting

Page 1 of 2 1 2 LastLast
Results 1 to 20 of 24

Thread: Default file save location in Powerpernt VBA

  1. #1
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location

    Default file save location in Powerpernt VBA

    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?

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi Howard,

    If the user has not alterd this path then it is by default %User%MyDocuments

    But this no good for you because a user could have changed this and what about foreign languages....

    Powerpoint is the least Robust Object model of them all and off course it doesn't provide what you want it to...(A simple Options.DefaultFileLocation = "bla")
    That would be to easy.....

    If you're up for it then you can off course to you're API Call thing on this challenge (To the options dialog) but there are Two Caveat'sI can think off)
    * Language
    * Office 97 the file box is on the Advanced tab (>97 the box is on the Save tab)

    Don't envy you doing that.....

    Another possibility is going into the registry and deal with the sucker over there...(not for everybody....be carefull for whome it concerns)

    It's just a guess but PP most hold that value somewhere normaly it's in the registry. (Not shure)

    I'll do a search for you later if there are better options!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  3. #3
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by MOS MASTER
    Hi Howard,

    If the user has not alterd this path then it is by default %User%MyDocuments

    But this no good for you because a user could have changed this and what about foreign languages....

    Powerpoint is the least Robust Object model of them all and off course it doesn't provide what you want it to...(A simple Options.DefaultFileLocation = "bla")
    That would be to easy.....

    If you're up for it then you can off course to you're API Call thing on this challenge (To the options dialog) but there are Two Caveat'sI can think off)
    * Language
    * Office 97 the file box is on the Advanced tab (>97 the box is on the Save tab)

    Don't envy you doing that.....

    Another possibility is going into the registry and deal with the sucker over there...(not for everybody....be carefull for whome it concerns)

    It's just a guess but PP most hold that value somewhere normaly it's in the registry. (Not shure)

    I'll do a search for you later if there are better options!
    Best option is the registry, that's easy to do.
    But I've decided to just use App.Path in VB 6 for my sample code that sets the VBA passwords.

    Too much trouble to hop around when testing if a different directory were to be used for Access, Excel, Powerpernt and Word. Haven't decided yet whether to add Outook.

    The password code is common to all, but there's a different front-end for each app, each in a separate command button's code. Just needs a short front end for Outlook.

    Oh well, I've been "awake" for about 26 hours, my stomach is growling, gotta eat then try to find my bed.

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi,

    Yeah PP trully sucks in it's Object model..still hoping on a better sollution then you're App.path...(I'll search tommorow)

    For now nighty night to yah!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  5. #5
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Best solution may be to retrieve, say, the path from powerpernt's recently used files registry key.

    Otherwise, powerpernt seems to default to the Office11 directory, a really dumb default!.

    For a VB 6 .exe, App.Path is fine for my sample code, tho noyt in a real app.

  6. #6
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi Howard,

    If the key is in Recent used file list than you could grab it from there to solve you're question (Didn't check that) if not then I wouldn't go for that approach.

    I don't agree that it defaults to the Office(8,9,10 or 11) folder at al my machines it defaults to the MyDocuments folder! (Couldn't explain why yours goes somewhere else)

    If the right key is not under Recent used file list then I would choose to get the default file save location from Word or any other app you could read it from.

    Most people save there documents in the same Root folder and if you can't find the true default than this would be my second best option!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  7. #7
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by MOS MASTER
    Hi Howard,

    If the user has not alterd this path then it is by default %User%MyDocuments
    Where is that documented?

    But this no good for you because a user could have changed this and what about foreign languages....
    I do not understand. If there's a defined default, I can always get that location from the registry, or somewhere. What "I;am asking is where is that default defined.

    I do not see anything in the registry.

    Powerpoint is the least Robust Object model of them all and off course it doesn't provide what you want it to...(A simple Options.DefaultFileLocation = "bla")
    THe setting has to be saved somewhere, but powerpernt vba may just not let us have access, no pun intended, in the same that access 97 vba is braindead wth regard to vbproject objects.

  8. #8
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi,

    Have not looked for any documentation on that. It's just a fact that it is on al of my machines.

    I also went in the registry and couldn't find it just like you. So that's why i suggested you use the settings of Word as the next best thing!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  9. #9
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by MOS MASTER
    Hi,

    Have not looked for any documentation on that. It's just a fact that it is on al of my machines.

    I also went in the registry and couldn't find it just like you. So that's why i suggested you use the settings of Word as the next best thing!
    4 me own purposes, it does not matter what is te default, it matters only when i'm putting out general code, as i did today. i've never bee4 released powerpoint code.

    it would not be good to have powerpernt dump things in, say word's default directory, unless the user specifically chose this. that's why most apps have a means to specify such defaults, if not thru the gui, then via registry setting. powerpernt seems to have braindead vba.

  10. #10
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Hi,

    True PP does have Braindead Object model!

    But I can't believe there is no way to gatter this information! I'll do another search tommorow..

    And yeas the Word option was a second best thing..witch sucks just as hard offcourse!

    Aah this merging feature of the board!
    Ok changed the default via the Options/Save tab en looked in the Registry.

    This the key I found:
    HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\PowerPoint\RecentFolderLis t

    Under the Default, RegExpandSZ I found the Path I just altered. (altered it again and did a registry refresh it changed so it?s the good path)

    Seams you can use this one for you?re query?
    Must be honest here...it does seam a strange place for this key...the options section would be much easier to find..
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  11. #11
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Quote Originally Posted by MOS MASTER
    .. Powerpoint is the least Robust Object model of them all ..
    I'll vote for Publisher, actually.

  12. #12
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by firefytr
    I'll vote for Publisher, actually.
    Me 2.

  13. #13
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by firefytr
    I'll vote for Publisher, actually.
    I don't

    If Howard's question was about Publisher then we could beg the differ in showing Publisher does have this little option..(Even in the right Property)
    [VBA]
    Sub PublicationPath()
    MsgBox Application.Options.PathForPublications
    End Sub
    [/VBA]

    No my vote for all time VBA Loser must go to InfoPath
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  14. #14
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by MOS MASTER
    I don't

    If Howard's question was about Publisher then we could beg the differ in showing Publisher does have this little option..(Even in the right Property)
    [VBA]
    Sub PublicationPath()
    MsgBox Application.Options.PathForPublications
    End Sub
    [/VBA]

    No my vote for all time VBA Loser must go to InfoPath
    My vote was based on what I recalled about the overall VBA support in Publisher. Of course, I have not checked in a while, but then who says the electorate must be informed?

  15. #15
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by Howard Kaikow
    but then who says the electorate must be informed?
    Nobody Howard...he should do what ever feels right to him!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  16. #16
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Hi Howard,

    A bit slow in noticing this thread...
    if your looking for a common/consistant place to save files across apps then you could use the FileSystemObject (or WSH) to get the users homedrive and directory (which I believe is how PPT sets it's default on install, though that's more of a hunch than anyhting)[VBA]Dim fs

    Set fs = CreateObject("Scripting.FileSystemObject")
    MsgBox Environ("HOMEDRIVE") & Environ("HOMEPATH")[/VBA] I frequently use this (and the "TEMP" and "TMP" settings for temp files) in distributed apps/addins to keep things simple
    Last edited by Killian; 05-06-2005 at 07:09 AM. Reason: to correct my appalling spelling
    K :-)

  17. #17
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by Killian
    Hi Howard,

    A bit slow in noticing this thread...
    if your looking for a common/consistant place to save files across apps then you could use the FileSystemObject (or WSH) to get the users homedrive and directory (which I believe is how PPT sets it's default on install, though that's more of a hunch than anyhting)[VBA]Dim fs

    Set fs = CreateObject("Scripting.FileSystemObject")
    MsgBox Environ("HOMEDRIVE") & Environ("HOMEPATH")[/VBA] I frequently use this (and the "TEMP" and "TMP" settings for temp files) in distributed apps/addins to keep things simple
    i was looking for powerpernt's default location, not for temp files.

    i won't use the scripting library in code/exe/dll to be used by others as hysterically, ooops, historically, auntie-virus software has picked on use of the scripting library.

  18. #18
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by Howard Kaikow
    i was looking for powerpernt's default location, not for temp files.
    Hi Howard,

    Am I correct that you won't settle for the Powerpoint path under registry key:
    HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\PowerPoint\RecentFolderLis t?

    Or have you found another approach yet..or dropped the thing entirely!
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

  19. #19
    VBAX Mentor
    Joined
    Sep 2004
    Location
    Nashua, NH, USA
    Posts
    489
    Location
    Quote Originally Posted by MOS MASTER
    Hi Howard,

    Am I correct that you won't settle for the Powerpoint path under registry key:
    HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\PowerPoint\RecentFolderLis t?

    Or have you found another approach yet..or dropped the thing entirely!
    recentfolderlist is not satisfactory for a default location.

    i would choose the default location based on the need of the app on a case by case basis.

  20. #20
    Administrator
    VP-Knowledge Base
    VBAX Guru MOS MASTER's Avatar
    Joined
    Apr 2005
    Location
    Breda, The Netherlands
    Posts
    3,281
    Location
    Quote Originally Posted by Howard Kaikow
    recentfolderlist is not satisfactory for a default location.
    Yes I said that before because I didn't understand yet that it holds the true value of the default filesave path that the user gave in Option/Save tab!

    I thought that recentfolderlist was some kind of MRU location and I agree that wouldn't tell you so much!

    Under the Default, (Type) RegExpandSZ key you can find the default file save path and I've checked this from 2000/2003 so this is the answer to your question....

    So am I not understanding you or are you looking for something else than your orginal question? (Yes I know I'm a nag but I'm sure I'm missing something here)
    _________
    Groetjes,

    Joost Verdaasdonk
    M.O.S. Master

    Mark your thread solved, when it has been, by hitting the Thread Tools dropdown at the top of the thread.
    (I don't answer questions asked through E-mail or PM's)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •