View Single Post
 
Old 08-10-2018, 12:31 AM
Zhibek Zhibek is offline Windows 10 Office 2013
Advanced Beginner
 
Join Date: Aug 2018
Location: Almaty, Kazakhstan
Posts: 30
Zhibek is on a distinguished road
Default Save as Document.docx in ShairPoint by using the command button

gmayor, Hello!

there is a macro which must save document in Shairpoint, but it doesn't work.
It works if I make SaveAs in computer location, but when I am using Shairpoint location it doesn't work,

Where is the mistake?


Private Sub CommandButton1_Click()
Dim OL As Object
Dim Doc As Document
Application.ScreenUpdating = False
Set Doc = ActiveDocument
Doc.SaveAs2 FileName:=("http://shairpoint/location/DMS_new") & "\" & Environ("username"), Fileformat:=wdFormatDocument, AddToRecentFiles:=True
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
End Sub
Reply With Quote