Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Access Source
I am using an Access table as my source for a mail merge. The database has a
password on it. Is there a way to use VBA to have it automatically enter the password when it is opened? I have a form in Access that contains a button that executes the open and mailmerge commands on the Word document file. |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Access Source
Sounds like we may be working on something similar. I'm stuck too. I'm
working on a "form filler" with Access as the source that will print multiple documents when complete. How did you create the control buttons to print from Access? Can you print 2 at a time? How about reprinting specific documents if necessary instead of all of them. If you have any insight to the problem, I sure would appreciate a response. Thanks "LDanix" wrote: I am using an Access table as my source for a mail merge. The database has a password on it. Is there a way to use VBA to have it automatically enter the password when it is opened? I have a form in Access that contains a button that executes the open and mailmerge commands on the Word document file. |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Access Source
Hi ?B?TERhbml4?=,
I am using an Access table as my source for a mail merge. The database has a password on it. Is there a way to use VBA to have it automatically enter the password when it is opened? I think this can be done using an ODBC connection and supplying the password with the PWD parameter. If you don't know how to explicitly select a connection method, you need to tell us the version of Office you're working with. Then try recording connecting to the Access database in a macro. If you need further help, after this point, we need to see the OpenDataSource the macro recorder created. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Access Source
"Cindy M." wrote: Hi ?B?TERhbml4?=, I am using an Access table as my source for a mail merge. The database has a password on it. Is there a way to use VBA to have it automatically enter the password when it is opened? I think this can be done using an ODBC connection and supplying the password with the PWD parameter. If you don't know how to explicitly select a connection method, you need to tell us the version of Office you're working with. Then try recording connecting to the Access database in a macro. If you need further help, after this point, we need to see the OpenDataSource the macro recorder created. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) Here is the code that is currently in the Word document VBA: Private Sub Document_Open() Me.MailMerge.OpenDataSource "\\calumet\apps\asset_tracking_system\Current Employee.odc" Me.MailMerge.ViewMailMergeFieldCodes = False Me.MailMerge.Destination = wdSendToNewDocument Me.MailMerge.Execute Me.Close End Sub Where do I add code to enter the password? |
#5
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Access Source
Hi ?B?TERhbml4?=,
I am using an Access table as my source for a mail merge. The database has a password on it. Is there a way to use VBA to have it automatically enter the password when it is opened? I think this can be done using an ODBC connection and supplying the password with the PWD parameter. If you don't know how to explicitly select a connection method, you need to tell us the version of Office you're working with. Then try recording connecting to the Access database in a macro. If you need further help, after this point, we need to see the OpenDataSource the macro recorder created. Here is the code that is currently in the Word document VBA: Private Sub Document_Open() Me.MailMerge.OpenDataSource "\\calumet\apps\asset_tracking_system\Current Employee.odc" Me.MailMerge.ViewMailMergeFieldCodes = False Me.MailMerge.Destination = wdSendToNewDocument Me.MailMerge.Execute Me.Close End Sub Where do I add code to enter the password? You don't. Please re-read my original message and answer the questions I asked. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
#6
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Access Source
Sorry, I thought the PWD parameter was something that could be added to that
code. I am using Office 2003. Do I start recording the macro in Word? |
#7
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Access Source
Hi ?B?TERhbml4?=,
Sorry, I thought the PWD parameter was something that could be added to that code. OLE DB is fussy; ODBC is more predictable. The code you showed me wants, in adddition, to use an secondary *.odc file. These are not well documented and it's difficult to get them to do what you think they ought to. I am using Office 2003. Do I start recording the macro in Word? Yes :-) In order to control the connection method in Word 2003, activate "Confirm conversions on open" in Tools/Options/General. This will show you a list once you've selected the file containing the data. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
#8
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Access Source
"Cindy M." wrote: Hi ?B?TERhbml4?=, Sorry, I thought the PWD parameter was something that could be added to that code. OLE DB is fussy; ODBC is more predictable. The code you showed me wants, in adddition, to use an secondary *.odc file. These are not well documented and it's difficult to get them to do what you think they ought to. I am using Office 2003. Do I start recording the macro in Word? Yes :-) In order to control the connection method in Word 2003, activate "Confirm conversions on open" in Tools/Options/General. This will show you a list once you've selected the file containing the data. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) I opened the database as ODBC. After saving the document, I reopened the database and tried executing the command from the form with the button. Same thing. Am I getting ahead of you? What do I do after selecting ODBC when I open the database as the source file? |
#9
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Access Source
Hi ?B?TERhbml4?=,
I opened the database as ODBC. After saving the document, I reopened the database and tried executing the command from the form with the button. Same thing. Am I getting ahead of you? What do I do after selecting ODBC when I open the database as the source file? In my original response I said: Then try recording connecting to the Access database in a macro. If you need further help, after this point, we need to see the OpenDataSource the macro recorder created. The point is to get the connection information Word requires for an ODBC connection, which will include a PWD (password) parameter. Then use this in your code, rather than what you already have. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
#10
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Access Source
That did it! Thank you for your help and patience.
"Cindy M." wrote: Hi ?B?TERhbml4?=, I opened the database as ODBC. After saving the document, I reopened the database and tried executing the command from the form with the button. Same thing. Am I getting ahead of you? What do I do after selecting ODBC when I open the database as the source file? In my original response I said: Then try recording connecting to the Access database in a macro. If you need further help, after this point, we need to see the OpenDataSource the macro recorder created. The point is to get the connection information Word requires for an ODBC connection, which will include a PWD (password) parameter. Then use this in your code, rather than what you already have. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
#11
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Access Source
Hi ?B?TERhbml4?=,
That did it! Great :-)! Thanks for letting us know it worked. Cindy Meister |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Word 2000 mail merge documents won't save Access 2000 data source | Mailmerge | |||
Access query as a mailmerge source | New Users | |||
Using Access as a Merge Source | New Users | |||
Mailmerge data source in an Access database will not open | Mailmerge | |||
Using as secured Access database as the data source for a mail mer | Mailmerge |