I want to assign an existing document to a variable which I can open and activate later. There might be several documents open when running the code (including the document containing the VBA project) so I need make sure I'm activating the right one.
The below doesn't work because I need the filename and not the file-path in the final line, but I don't know how to extract this from the path in line 2...
Dim NewQuote1 as string
Set NewQuote1 ="C:\Library\doc1.docx"
Documents.Open fileName:=NewQuote1
...
Documents(NewQuote1).Activate