I had a document that was created in Word 2003 (vba 6.5)/Windows XP. One of the operations of this document was to open another document that the user selects when clicking on a command button. This was done through the following code.
Documents.Open fileName:=matrixdoc, ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto, Visible:=False
We have now moved to a new environment; Word 2010 (VBA 7)/Windows 7.
Since this we have had problems with this code. If the files have been stored on a local drive, when the user selects a file “ “ is added to the file name e.g “”c:\file.docx””. If the file is stored on a network drive, this isn’t the case, so the selected file will be “c:\file.docx”.
Does anyone know why this is happening and whether there is a quick fix rather than having to do an IF statement to see if “” has been added to the file name and deleting if it has?
It is causing a problem because these files can be stored either on a local or network drive so I need a system that works in both scenarios.