Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by sda7bobp

  1. sda7bobp

    Checking to see if Form is open

    Thank you, Roy. I knew I had seen it, but just could not locate it or think of it. Bob
  2. sda7bobp

    Checking to see if Form is open

    I should know this, but having a brain skip: How can I check in code to see if a form is open? Thanks, Bob
  3. sda7bobp

    Problem with running mail merge from Access

    I have an Access database from which I would like to print a MailMerge. The code I am using runs on a click event from a form in Access. It launche Word, opens the template into which the data is merged, and sucessfully completes the merge. The problem comes when I attempt to print the merged...
  4. sda7bobp

    Can't open database

    Play with the macrorecorder when doing that. I'm sorry, I don't understand what you are asking me to do. Should I just eliminate the code that doesn't seem to work and complete the merge and printing manually? Or are you suggesting a macro from within Access to complete the task? Bob
  5. sda7bobp

    Can't open database

    PH, Word 97 SR2 What happens when you double-click AccessSurgRpt.dot in an Explorer window ? --It opens to the template without merging the data, as I would expect. It does this through the code also. It gets that far and then the error message comes up. If I try to complete the merge from...
  6. sda7bobp

    Can't open database

    Tom, I removed that line and got the same error 5922 "Word was unable to open the database". Sorry I did not include that in the original post. Bob
  7. sda7bobp

    Can't open database

    Adapting some code I got here last week for another database (in which it is working well) I am having a problem opening an Access database to do a mailmerge in Word. The database that can't be open is the one that is calling the mail merge. Here is the code with the porblem area in red...
  8. sda7bobp

    Controlling Word from Access

    PH and Paul, The code that is presently working and doing very well is: Public Function MergeIt1() Dim odoc As Word.Document, objWord As Object Set objWord = CreateObject("Word.Application") objWord.Visible = True Set odoc = objWord.Documents.Add("C:\Program Files\Microsoft Office\Templates\Lyme...
  9. sda7bobp

    Controlling Word from Access

    Paul, I really thank you for the time you have put into assisting me in this bit of code. In the Reference library I find 3 Microsoft ActiveX Data Objects 2.x Libraries. The program will only allow 1 of those to be checked at a time or it will yield a naming conflict error. They are 2.1...
  10. sda7bobp

    Controlling Word from Access

    I am getting an error "ActiveX component can't create object" Public Function MergeIt() Dim odoc As Word.Document Set odoc = GetObject("C:\Program Files\Microsoft Office\Templates\LymePositive.dot", "Word Document") odoc.MailMerge.OpenDataSource _ Name:="C:\My...
  11. sda7bobp

    Controlling Word from Access

    Ken, I find available references, but from there I am lost. Any help would be appreciated. Bob
  12. sda7bobp

    Controlling Word from Access

    Oh, I'm running Access 97 Bob
  13. sda7bobp

    Controlling Word from Access

    Paul, I get an error with the Dim statement: "User defined type not defined". Public Function MergeIt() Dim odoc As Word.Document Set odoc = GetObject("PathtoyourFormLetter", "Word Document") odoc.MailMerge.OpenDataSource _ Name:="PathTo.mdbFile", _ linktosource: = True, _ connection:="QUERY...
  14. sda7bobp

    Controlling Word from Access

    Thanks, Paul and Tom. I have just gotten back to working on this and will try your suggestions. Bob
  15. sda7bobp

    Controlling Word from Access

    I have never used the Shell function before, so I am not certain just how to get done what I need. I need to open Word from Access, then open a form letter template that gets its data from the Access database from which I am opening Word. Then merge the data and print the letters. I can open...

Part and Inventory Search

Back
Top