Hey everyone,
Short version:
VBA code in Access to fill two Word forms then save them as PDF. Getting an error that "normal.dot" is in use when second Word file is opened.
Long version:
I have a small program set up in Microsoft Access to take a selected record, copy the information into a Microsoft Word form, and then "Print" the form as a PDF.
The problem I am having is that I sometimes need to create two separate PDF files from two different Word documents. I have no trouble opening up the files and filling in the forms, but the trouble arises when I try to print as PDF.
The code is currently set to open one Word file, complete it, print it as PDF, close it, and then repeat with the second file. The problem that arises is that the second Word file tries to open before the first has completely closed. The result is that I get an error message saying that Normal.dot is in use and a prompt to save the file.
I managed to get around this by building in a time delay between the close of the first and the opening of the second file, but that is a bit of a messy fix.
Is there any way around this? Ideally it would be some way to expedite the printing where both Word files can be open at once, but alternatively it would help to detect when the first version of Word is closed down before the second document opens.
Any suggestions? Thanks in advance for your help!
Short version:
VBA code in Access to fill two Word forms then save them as PDF. Getting an error that "normal.dot" is in use when second Word file is opened.
Long version:
I have a small program set up in Microsoft Access to take a selected record, copy the information into a Microsoft Word form, and then "Print" the form as a PDF.
The problem I am having is that I sometimes need to create two separate PDF files from two different Word documents. I have no trouble opening up the files and filling in the forms, but the trouble arises when I try to print as PDF.
The code is currently set to open one Word file, complete it, print it as PDF, close it, and then repeat with the second file. The problem that arises is that the second Word file tries to open before the first has completely closed. The result is that I get an error message saying that Normal.dot is in use and a prompt to save the file.
I managed to get around this by building in a time delay between the close of the first and the opening of the second file, but that is a bit of a messy fix.
Is there any way around this? Ideally it would be some way to expedite the printing where both Word files can be open at once, but alternatively it would help to detect when the first version of Word is closed down before the second document opens.
Any suggestions? Thanks in advance for your help!