Hi all
I am currently using the below code to open a document
Is there a way to only get access to search for the document within the main folder path rather than the whole CDrive, for example I know with HTML etc you can put ../ etc, the issue I have is if the database gets moved to another drive then I need to manually change the file path so it still looks for it in the correct place? if it cannot be done its not a big issue
Example of how I mean
I am currently using the below code to open a document
Code:
Set oWd = CreateObject("Word.Application")
Set oDoc = oWd.Documents.Add("C:\Users\Databases\HRRecords\Reports\HRReportFile.docx")
Is there a way to only get access to search for the document within the main folder path rather than the whole CDrive, for example I know with HTML etc you can put ../ etc, the issue I have is if the database gets moved to another drive then I need to manually change the file path so it still looks for it in the correct place? if it cannot be done its not a big issue
Example of how I mean
Code:
Set oWd = CreateObject("Word.Application")
Set oDoc = oWd.Documents.Add("..\Reports\HRReportFile.docx")
Last edited: