Language independent way to get “My Documents” folder in VBA Excel 2003

后端 未结 1 594
梦毁少年i
梦毁少年i 2020-12-16 11:51

I need a Language independent way to get \"My Documents\" folder in VBA Excel 2003.

What I have:

Public Function MyDocsPath() As String
    MyDocsPat         


        
相关标签:
1条回答
  • 2020-12-16 12:35

    This may suit:

    Set WshShell = CreateObject("WScript.Shell")
    strDocuments = WshShell.SpecialFolders("MyDocuments")
    

    From: http://msdn.microsoft.com/en-us/library/0ea7b5xe.aspx

    Although the special folder name is MyDocuments, it refers to the documents folder for several versions of Windows.

    0 讨论(0)
提交回复
热议问题