Hi all.
I am looking to automate saving a Word doc to our SharePoint intranet. The code below gives me an error massage saying "Run Time error ;4172'. Path not found" despite the fact that the URL is correct and I am able to upload documents here.
Sub SaveToSharePoint()
' Declare some variables
Dim outputDirectory As String
Dim currentFilename As String
Dim outputNameFull As String
' Define output name using vars
currentFilename = ActiveDocument.Name
outputDirectory = "https://SHAREPOINT PAGE HERE"
outputNameFull = (outputDirectory & "/" & currentFilename)
ChangeFileOpenDirectory outputDirectory
ActiveDocument.SaveAs2 FileName:=outputNameFull, _
FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", _
AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
:=False, SaveAsAOCELetter:=False, CompatibilityMode:=15
End Sub
Any help would be greatly appreciated.
Thanks
Sun
Bookmarks