If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Call Link to MS Word from a User-defined Menu
Hi All, please help me with this problem.
I have a database that has its own Menu and Submenus, and a document in Word that uses Mail Merge data from this database (I could have created a report for this document, but, as far as I know, Access does not have the JUSTIFIED ALIGNMENT feature (alignment both to the left and the right, as in MS Word, so I decided to leave it in MS Word). What I want to do is to have a command in the MENU showing the link to this document in Word, which should be open ONLY FOR THE RECORD CORRESPONDING TO THAT ONE I AM CURRENTLY HAVING IN MS ACCESS DATABASE (filtered). Thanks for any help |
#2
|
|||
|
|||
Hello,
you are in luck, i have done the same thing. First of all create a macro with the action "RunApp." Then in the command line, enter the directory extension for Microsoft Word (It can be found through start -- run. It looks something like this: "c:/program files/office10/winword.exe"). Directly after the directory for Word, enter the directory location for the document. Again - something like this: "c:/my documents/document1.doc" Save the macro. Go into the form design view and open the toolbox. From there create a new command button. The wizard will come up and under categories, select misc. and in the right hand column click run macro. From there, follow the steps for the command button to be linked to macro you just created. NOW, go to the query that is attached to the Word document. In the criteria for one of the fields (preferably an id field or something like that) Write the following code: [Forms]![NameOfForm]![NameOfField] Mine looked something like this: [Forms]![Client_Info]![ID] So after all that, if you go to your form and click the new button you made, it should pass all your info to word and then all you have to do is merge it and you will get your one record. Hope that helps, Ilan -----Original Message----- Hi All, please help me with this problem. I have a database that has its own Menu and Submenus, and a document in Word that uses Mail Merge data from this database (I could have created a report for this document, but, as far as I know, Access does not have the JUSTIFIED ALIGNMENT feature (alignment both to the left and the right, as in MS Word, so I decided to leave it in MS Word). What I want to do is to have a command in the MENU showing the link to this document in Word, which should be open ONLY FOR THE RECORD CORRESPONDING TO THAT ONE I AM CURRENTLY HAVING IN MS ACCESS DATABASE (filtered). Thanks for any help . |
#3
|
|||
|
|||
Hi Ilan,
Thank you very much for having replied to my question. As I am currently on travel for a few days, I would follow your instructions as soon as I get back and I´ll let you know of the result. Once again, lots of thank. Regards, LPC "Ilan" wrote: Hello, you are in luck, i have done the same thing. First of all create a macro with the action "RunApp." Then in the command line, enter the directory extension for Microsoft Word (It can be found through start -- run. It looks something like this: "c:/program files/office10/winword.exe"). Directly after the directory for Word, enter the directory location for the document. Again - something like this: "c:/my documents/document1.doc" Save the macro. Go into the form design view and open the toolbox. From there create a new command button. The wizard will come up and under categories, select misc. and in the right hand column click run macro. From there, follow the steps for the command button to be linked to macro you just created. NOW, go to the query that is attached to the Word document. In the criteria for one of the fields (preferably an id field or something like that) Write the following code: [Forms]![NameOfForm]![NameOfField] Mine looked something like this: [Forms]![Client_Info]![ID] So after all that, if you go to your form and click the new button you made, it should pass all your info to word and then all you have to do is merge it and you will get your one record. Hope that helps, Ilan -----Original Message----- Hi All, please help me with this problem. I have a database that has its own Menu and Submenus, and a document in Word that uses Mail Merge data from this database (I could have created a report for this document, but, as far as I know, Access does not have the JUSTIFIED ALIGNMENT feature (alignment both to the left and the right, as in MS Word, so I decided to leave it in MS Word). What I want to do is to have a command in the MENU showing the link to this document in Word, which should be open ONLY FOR THE RECORD CORRESPONDING TO THAT ONE I AM CURRENTLY HAVING IN MS ACCESS DATABASE (filtered). Thanks for any help . |
#4
|
|||
|
|||
Hi Ilan, I followed your instructions and it works brillantly, for the first phase (call Word and open the document), but as to the filtered records, I still have problem because my Word document is a Main Merge document (it already contains the record source from the database, with the fields picked up and set in place). What I want is to open this document and it directly goes to the record I have in the form (not the procedure that you indicated me, namely to pass the information to Word before merging it). I have tried to select the record source that is a Query with criteria, but Word seems not to recognize these Queries (they do not appear in the list of tables and queries of the source database). So, the result I have so far is that I can open that document from my database, but I still have to search for the record that I want "manually" in Word. If you, or anyone else, can help me figure out this problem, I would much appreciate it. Thanks in advance, LPC |
#5
|
|||
|
|||
Hi, I've found the answer.
To open the word document and merge it immediately from Access, I changed the query type from Selection query to Make-Table Query. The table created by that database then will serve as the source table for the word document. That's all. LPC |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Continuous breaks convert to next page breaks | Jennifer Hunt | General Discussion | 2 | December 30th, 2004 05:45 PM |
macro in word | js | General Discussion | 1 | December 28th, 2004 03:01 AM |
REVEAL CODES feature like in Word Perfect? | MBSS | New Users | 4 | November 21st, 2004 07:47 PM |
wordperfect documents to word | General Discussion | 3 | September 6th, 2004 03:17 AM | |
Codes | G.W. | Page Layout | 3 | April 29th, 2004 10:50 PM |