以语言独立的方式获得“我的文档”文件夹在VBA Excel 2003中 [英] Language independent way to get "My Documents" folder in VBA Excel 2003
问题描述
我有什么:
公共函数MyDocsPath()As String
MyDocsPath = Environ $(USERPROFILE)& \My Documents\
结束函数
因为程序将被用于至少有2个lang MS Windows,并且每个语言的我的文档名称都会更改。
有没有办法,或者我应该尝试找出系统lang和成为具体?
这可能适合:
设置WshShell = CreateObject(WScript.Shell)
strDocuments = WshShell.SpecialFolders(MyDocuments)
来自: http://msdn.microsoft.com/en-us/library /0ea7b5xe.aspx
虽然特殊文件夹名称是MyDocuments,但它指的是Windows的多个版本的文档文件夹。
I need a Language independent way to get "My Documents" folder in VBA Excel 2003.
What I have:
Public Function MyDocsPath() As String
MyDocsPath = Environ$("USERPROFILE") & "\My Documents\"
End Function
Because the program will be used in at least 2 lang MS Windows, and the "My Documents" name changes for each language.
Is there a way, or should I try to figure out the system lang and become specific?
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.
这篇关于以语言独立的方式获得“我的文档”文件夹在VBA Excel 2003中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!