Passing a string from Access to be used in Word Macro 
Author Message
 Passing a string from Access to be used in Word Macro

I run a query in Access and create an array from the
results.  I would like to be able to use this array in a
Word macro, after starting Word from Access.
or can I run the Access query from Word(macro) and create
and use the array in the macro.

Thank you very much.

Rick



Mon, 21 Nov 2005 21:37:04 GMT  
 Passing a string from Access to be used in Word Macro
You can certainly write the code in Word that does a query on the ms-access
file.

If you are doing a mail merge/template thing to word, then you can check out
my word merge code at:
http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html

If you are not looking for a word merge template, the you can code in word:

You word code could look like:

   Dim strCon     As String
   Dim cCon       As New adodb.Connection
   Dim rst        As New adodb.Recordset
   strCon = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
            "User ID=Admin;" & _
            "Data Source=C:\My Documents\db4.mdb"
   cCon.ConnectionString = strCon
   cCon.Open
   rst.Source = "select * from tblFruits"
   rst.ActiveConnection = cCon
   rst.Open

. do whatever...

--
Albert D. Kallal     (MVP)
Edmonton,  Alberta Canada

http://www.attcanada.net/~kallal.msn



Mon, 21 Nov 2005 23:07:59 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help Needed - Passing Value from Access 97 to Word 97 Macro

2. I am seeing a ghost in the list of macros in Word 2002

3. Word 97 Macros > Word XP Macros

4. Passing strings/variables between userform and macro

5. running a macro from c and passing a string to it

6. passing params to word macro

7. Passing recordset to a Word macro

8. Passing Parameters to a Word 97 Macro from VB

9. customizing Word 97 via a word macro & passing data from Access to word

10. How can I pass strings to word doc

11. I am trying to update a record, i am not using data control

12. I am trying to update a record, i am not using data control

 

 
Powered by phpBB® Forum Software