Results 1 to 8 of 8
  1. #1
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    340

    Set InitialDir


    I'm using Ken Getz ahtCommonFileOpenSave API in Access VBA.
    Is it possible to send in ThisPC as the InitialDir ?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Why not try? I did. ThisPC doesn't seem to mean anything in VBA.

    Try:

    fd.InitialFileName = "file:\"

    or

    fd.InitialFileName = "file:\\"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    340
    ThisPC would mean something to readers here.
    Were those good suggestions? They didn't work here.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    AFAIK, ThisPC is a pointer to OneDrive/Documents IF OneDrive pc folder backup option is turned on.
    However, when I examine OneDrive properties the location is shown as C:\Users\userNameHere so it seems the answer would be no. I've read that OneDrive is just a namespace junction and to me, ThisPC is also.

    Happy to be proved wrong though if that's not the case because there seems to be an API for everything these days.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    340
    Thanks @Micron, I couldn't sort it either. Give up time, would have been handy.

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Perhaps "ThisPC" is a 'moniker' for something else you can use - (like, but not exactly) %UserName%, or %HOME%, etc.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Well, they didn't error. But on second look, I do see just points to Documents folder.

    I do have hard drive backup but not OneDrive.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    340
    Thanks. Failing anyone with a solution I'll use C:\
    Normally the BroweFile routine is given a Path, but this was a catchall if it wasn't present.

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums