Word VBA ChangeFileOpenDirectory-网络路径
我正在尝试编写VBA宏,该宏将打开公司sharepoint在线网站上的特定网络库,并允许我选择多个word文件并将它们合并到一个文件中。我正在努力绘制所需的shp库。如果我将ChangeFileOpenDirectory指定到我的本地文件夹C:User\Documents\test中,一切正常。然而,一旦我尝试映射在线库,对话框就会在我的文档中本地打开 我当前的代码如下所示:Word VBA ChangeFileOpenDirectory-网络路径,vba,sharepoint,Vba,Sharepoint,我正在尝试编写VBA宏,该宏将打开公司sharepoint在线网站上的特定网络库,并允许我选择多个word文件并将它们合并到一个文件中。我正在努力绘制所需的shp库。如果我将ChangeFileOpenDirectory指定到我的本地文件夹C:User\Documents\test中,一切正常。然而,一旦我尝试映射在线库,对话框就会在我的文档中本地打开 我当前的代码如下所示: Sub Open_Dialog() Dim dlgFile as FileDialog Dim
Sub Open_Dialog()
Dim dlgFile as FileDialog
Dim nTotalFiles As Integer
Dim nEachSelectedFile As Integer
Set dlgFile = Application.FileDialog(msoFileDialogFilePicker)
ChangeFileOpenDirectory "\\companysite.sharepoint.com@SSL\DavWWWRoot\sites\desired-folder-name"
with dlgFile
.InitialFileName = "\\companysite.sharepoint.com@SSL\DavWWWRoot\sites\desired-folder-name"
.AllowMultiSelect = TRUE
If. Show <> -1 Then
Exit Sub
Else
nTotalFiles = .selectedTimes.Count
End if
End With
...
(the rest of the code for merging that works)
...
End Sub
子打开_对话框()
Dim dlgFile as FILE对话框
将所有文件设置为整数
Dim nEachSelectedFile为整数
设置dlgFile=Application.FileDialog(msoFileDialogFilePicker)
ChangeFileOpenDirectory“\\companysite.sharepoint。com@SSL\DavWWWRoot\sites\desired folder name“
用dlgFile
.InitialFileName=“\\companysite.sharepoint”。com@SSL\DavWWWRoot\sites\desired folder name“
.AllowMultiSelect=TRUE
如果。那么表演-1
出口接头
其他的
nTotalFiles=.selectedTimes.Count
如果结束
以
...
(合并工作代码的其余部分)
...
端接头
@SSL\davwwroot地址是从库属性复制的
有什么想法吗,为什么网络路径不起作用?非常感谢任何反馈