VBA 程序的目的是将插入的信息填充到 Excel 表格中,完成后转换为 PDF 文件。然后要求用户选择保存文件的路径。现在我还想将该 PDF 保存到 SharePoint 的固定目标。到目前为止,我无法弄清楚我应该如何告诉 VBA 该 SharePoint 的路径。以下是当前保存文件的方式。保存到 SharePoint 是否以类似方式工作?
Sheets("Example").Select
Dim varResult As Variant
Dim ActBook As Workbook
'Select path and file name
'PDF
varResult = Application.GetSaveAsFilename(FileFilter:= _
"PDF (*.pdf), *.pdf", Title:="Save File", _
InitialFileName:="Example " & UserForm2.TextBoxExampleNumber.Value)
'Adding Key words
ActiveWorkbook.BuiltinDocumentProperties("Keywords") = UserForm2.TextBoxExampleNumbewr.Value & " " & UserForm2.TextBoxDate.Value & " " & UserForm2.TextBoxUsername.Value & " XXX" & " YYY" & " ZZZ"
'PDF EXPORT
ActiveSheet.ExportAsFixedFormat Filename:=varResult, Type:=xlTypePDF, OpenAfterPublish:=True, _
IncludeDocProperties:=True
我也使用 sharepoint - 我有可以直接上传到 Sharepoint 的宏。您需要在文件资源管理器和 Sharepoint 之间建立连接。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句