M
Michael Suttkus, II
I have a file that produces envelopes based on an Access database. When
opened manually, this works perfectly.
Unfortunately, I need VBA to open it and print off the envelopes. This
works less well.
When opened manually, a dialog box opens which reads "Opening this document
will run the following SQL command:" followed by a snippet of the relevant
SQL and a warning that this will extract information from the database. When
"Yes" is clicked, all is well. But when VBA opens the file, there is no
equivalent to this dialog and the file loses it's connection to the database.
I have tried repeatedly to programatically resestablish it without success.
(To clarify, when try to reattach the database to the mailmerge document, VBA
responds by asking the user to supply the reconnection information, rather
defeating the purpose of automating this in the first place.)
Is there a simple way to have VBA just open the file and maintain the
connection already present?
opened manually, this works perfectly.
Unfortunately, I need VBA to open it and print off the envelopes. This
works less well.
When opened manually, a dialog box opens which reads "Opening this document
will run the following SQL command:" followed by a snippet of the relevant
SQL and a warning that this will extract information from the database. When
"Yes" is clicked, all is well. But when VBA opens the file, there is no
equivalent to this dialog and the file loses it's connection to the database.
I have tried repeatedly to programatically resestablish it without success.
(To clarify, when try to reattach the database to the mailmerge document, VBA
responds by asking the user to supply the reconnection information, rather
defeating the purpose of automating this in the first place.)
Is there a simple way to have VBA just open the file and maintain the
connection already present?