VBA, create a Folder in Sharepoint

Joined
Aug 6, 2011
Messages
2
Reaction score
0
I apoligize if my question may seem stupid but I have no formal training with regards to programming (vba or other). I am trying to organize my company a bit through programming using word forms.

I was able to create a macro that would automatically create a folder if it was not found. The problem I'm having is that although this works on my local computer, I cant get the code to work on SharePoint. I understand that the "\" in my local computer need to be changed to "/" when refering to Sharepoint address. I also understand that the last "/" should be removed but not 100 Percent sure. Ive tried more that a 100 combinations of codeing and still for the life of me cant get it. I have been trying all kinds of things and going on 1 week and can't get it. Can someone help me PLEASE???

Best Regards / Ginovp41

My code is listed below.


Sub CreateFolder()
Dim strTempDirPath as String
Dim strCompanyPath as String
Dim Company as String

Company = ActiveDocument.FormFields("Company").Result

strCompanyPath = "c:\Documents and Settings\ginop\desktop\training" _
& Company & "\"

If Dir(strCompanyPAth, vbDirectoy) <> "" Then
strTempDirPath = strCompanyPath
Else: MkDir (strCompanyPath)
strTempDirPAth = strCompanyPath
End if

End Sub
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top