Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

What is the alternative for DIR when using VBA to call Sharepoint?

Avatar of jwandmrsquared
jwandmrsquared asked on
Microsoft AccessMicrosoft SharePoint
11 Comments1 Solution5026 ViewsLast Modified:
I am redesigning a few features on my Access database to be able to function in citrix.  One of those is the repointing from a share drive (local client machine) to using sharepoint mapping.  The script below worked fine from a mapped drive to determine if a file already existed, however, it generates 2 different errors now:

Me.File_Path.DefaultValue = """http://techsp/sites/techven/Shared%20Documents/Product%20Analysis%20Forms%20-%20People%27s%20Court/2010%20Product%20Analysis%20Responses/DB%20Testing/"""

filepath = me.file_path

Dim dlg As Word.Dialog
Options.DefaultFilePath(wdDocumentsPath) = filepath -->This generates error 5417...essentially that filepath is not valid.
If Dir$(filepath & pplcMonth & digyear & "_" & vndr & prodId & ".doc") = "" Then --->if I comment out the options.default command, then error Runtime Error 52, bad file name or number appears.
 doc.SaveAs (filepath & pplcMonth & digyear & "_" & vndr & prodId & ".doc")
'if it exists then prompt for save
    Set dlg = appWord.Dialogs(wdDialogFileSaveAs)
    dlg.Name = pplcMonth & digyear & "_" & vndr & prodId & ".doc"
'if not exists, then save it (not as template)
 End If


What is another way I can check for existing file either from Access or from Word?
Avatar of Ted Bouskill
Ted BouskillFlag of Canada imageSenior Software Developer
This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answers