Bug word from access

  • 13 years ago

    I wrote this code which when runned just expplode my access.
    (MSACCESS as generated error and will be closed by Windows...)
    I use Office 2000.

    Could some one try it and tell me if he got the same problem.

        Dim appWord As Word.Application
    Dim docTemp As Word.Document
    Dim rngManip As Word.Range

    Set appWord = New Word.Application
    appWord.Visible = True

    Set docTemp = appWord.Documents.Open("AnyWordFile")

    Set rngManip = appWord.ActiveDocument.Range
    rngManip.Find.Text = "1" 'KAAABOOOOM

  • 13 years ago

    Yes and no - I tried it yesterday and every Find.method caused it to bomb out; I managed to find out it was a problem with OLE from the error message being generated.

    Today, I tried it on a different PC with the same OS and programs and it works fine... The only difference was that I typed it in from scratch today, whereas yesterday I copied and pasted your code, so I don't know if there's a hidden character in there somewhere that's causing a problem.

  • 13 years ago


    Your code is OK, I have tested it using access 97, 2000, 2003 and it just work. Just make sure you have referenced the correct version of word in your access references list.

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In theory, theory and practice are the same. In practice, they're not.”