Access from Word

Franki

Registered User.
Local time
Today, 14:17
Joined
Sep 19, 2000
Messages
12
Thanks to the help of the many Access gurus online, I have built a custom rolodex which is a almost litigation secretary's dream. It's been a steep learning curve the last few months, but I've done it.

Now, I need to make the final hook-up. Specifically, I need to be able to import from Access the addresses of people to whom we are writing.

What I envision is a form in Word which has a combo box populated by the Contact list in the Access rolodex. The secretaries would be able to make multiple choices of contacts (we often write to 4 or more people at a time); the addresses would be placed in a two-columned Word table as text. We also need check boxes to get the appropriate "heading" on each addressee's letter -- attorney-client privilege, joint-defense privilege, etc., and a check box for whether the letter is sent by fax and/or e-mail including the fax number or e-mail address (e.g. "via telecopier -- [fax number]

I've tried using MailMerge or Insert Database field, but it doesn't do what I want, and causes other problems (such as opening the Access database 3 times without ever closing any instance of it -- very slow, very annoying, and very cumbersome). So, any guru's out there with the Automation experience to help this decidedly inexperienced potential VBA user?

Thanks in advance.
 
This does not answer all of your question but one issue to look out for is that Access does not allways close after it has been used in automation. this is a recognised problem and the solution is to allways use a QUIT. The CloseCurrentDatabase is not allways sufficient. The help file example does not show the use of the QUIT

Example
Dim AppAccess As Access.Application
Set AppAccess = New Access.Application

AppAccess.OpenCurrentDatabase YourExternalDbnameAsString

'Your Code here....
'
'

AppAccess.CloseCurrentDatabase

'Place a QUIT here to ensure Access Closes
AppAccess.Quit

Set AppAccess = Nothing


For further details
Kb Q210129 Explicitly close the instance.....

Hope this helps a bit
Regards
Trevor from www.accesswatch.co.uk



[This message has been edited by accesswatch (edited 10-16-2000).]
 
Thank you, Trevor. This gets me one step along the way -- at least I can get Access to open from Word (instructions from other places got me no where). One small step... one small success... gives me hope, at least!
 
Franki
I recently found a procedure described in the Smart Access Newsletter that might help you. It requires a bit of digestion but it is not impossible. It will allow you to place the results of one or more Access Queries into a highly formatted Word document. You would be able to loop through the selected values within a Combo box and create custom letters based on each value. You should also be able to add the letter text using a temporary table (I think). Check this link and let me know if you have any problems. I was able to produce some nearly identical copies of my Access Reports with this code.
Let me know what happens...
Chris
 
Why do you need to use word, can you not use access to produce your letters?
 
Chris -- I can't find your link, but did a search and found the Smart Access newsletter; good stuff, it may give me some more hints.
 
Ritchie -- there are several reasons for not just doing it all in Access. One major, major reason is that my solution needs to be user-friendly for both secretaries and lawyers alike; the easier I make it on the lawyers, the more of their own routine word-processing they will do. 2nd, we are pretty savvy Word users, and very exacting in our formatting requirements -- I want especially the secretaries to be working in the environment with which they are most familiar. Third, I don't want to make people switch programs when they go from one task to the next (e.g. writing a two page letter to making changes to a 50 page pleading); I also don't want them hanging out all day with the database open; last is that I'm something of a perfectionist and want to be able to do this what I perceive is the "right" way. I don't want to end up like the carpenter who treats every task like as a nail because his only tool is a hammer. I will go the through Access route as a last resort -- and then only until I can figure out how to do it "right".
 
Franki
I am just a beginner with Access but I am very interested in your dilemna. Could you please keep me posted on this project.
I think it could be done because one of the great virtues of VBA is that it can connect almost any of the MSOffice products together. Have you checked the MSWord help?
I remember when I was working with a database and a spreadsheet. I had some problems writing VBA in Excel but I checked the Excel help and it was very useful Ilearned how to write code for command buttons that you could put on spreadsheets and I also learned more about the Excel toolbar for coding for controls.
Whatever happens please keep me posted my email is jkc3computerhack@yahoo.com

good luck
John
 
Mmm interesting reply I accept the limitations of access in your case with a 50 page document, I only asked because I used to use word a lot as you do however I became increasingly frustrated with the same problems that your having, discovering that the great Microsoft flagship is not so integrated as they would have us believe, something that StarOffice manages relatively easily or so I'm told I wish you luck please keep us posted if the posted link works for you.
 
The code link Chris sent me is... dense. But I think something like that will allow me to trick the other users into thinking they have never left Word at all -- start and end in Word, using VBA in Word to shut down Access after all is done. I am going to need more help, though. I've learned just enough about Access to plant and adapt code -- but not quite enough to initate a lot of code on my own. Be posting frequently the next few days, I'm sure. -- Franki
 

Users who are viewing this thread

Back
Top Bottom