Consulting

Results 1 to 3 of 3

Thread: Access to word document fails

  1. #1
    VBAX Newbie
    Joined
    Apr 2005
    Posts
    2
    Location

    Lightbulb Access to word document fails

    Please help me out here.
    I am a complete newbie in VBA world.
    It is very hard for me to explain everything in correct english because i use a Dutch version of Office 2003.

    Config:

    Windows xp sp2 Dutch
    Office Professional 2003 Dutch


    Problem:

    I use the following sub to call a word document:

    On Error GoTo Err_Knop3_Click
        Dim oDoc As Object
        Dim strBestand As String
        strBestand = "c:\test.doc"
    Set oDoc = CreateObject("Word.Application")
        oDoc.Visible = True
        oDoc.Documents.Open (strBestand)
        oDoc.Activate
    Exit_Knop3_Click:
        Exit Sub
    Word opens the right document, but the merge options are grayed out. In the original document it all works perfect, but opened from the access form, the document looses all mysql merge options.
    I know there is an option to merge a query direct into word for a mailing to a printer. But i want to automate it.

    What is the best solution to solve my problem?
    Please help me out here, i'm starting to like access as it is, but the vba is a bit hard for me at the moment.
    Last edited by Aussiebear; 04-09-2023 at 05:19 AM. Reason: Adjusted the code tags

  2. #2
    VBAX Master Killian's Avatar
    Joined
    Nov 2004
    Location
    London
    Posts
    1,132
    Location
    Hi and welcome to VBAX

    This sounds like an issue I ran across before - MS have closed a number "security loopholes" in their regular updates, one that prevents the SQL connect for the merge from being run from VBA.
    There's an registry hack to open it back up detailed here:
    http://support.microsoft.com/defaul...KB;EN-US;825765
    K :-)

  3. #3
    VBAX Newbie
    Joined
    Apr 2005
    Posts
    2
    Location

    Thumbs up

    SUPERB!

    This really did the trick! Thank you very much, I had no idea anymore.
    I tested it, and it just works great!
    Next step is to automate this by vba code, but I think I can manage that now.

    Once again, a forum really helped me out, thanks Killian. Keep up the good work by helping others.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •