[AccessD] Automation Error

Rocky Smolin rockysmolin2 at gmail.com
Thu Aug 24 17:53:24 CDT 2023


Dear List:

I'm trying to create a word doc through automation from an A2010 app. Early
binding.

Code snip:
    Dim wordApp As Word.Application
    Dim myDoc As Word.Document

    Set wordApp = CreateObject("Word.Application")

I get an Automation Error: library not registered.  On advice from Edge I
renamed the Word folder in the registry. Restarted Word. The registry was
recreated. But still the same problem.

I got out my old A2010 CD and ran a repair. No cigar.

Suggestions?

I originally went with late binding but ran into a problem with setting
font size and alignment.

The code

    'wordApp.Selection.FontName = "Book Antiqua"
    'wordApp.Selection.Font.Size = 18
    'wordApp.Selection.ParagraphFormat.Alignment = 1

won't compile. Says Object Won't Support this Property or Method.

I got that code by recording a macro in Word and cribbing the code from the
macro (always worked with excel but I was always using early binding).

So there's two problems.

If I can solve the second one I'll go with late binding. If I can solve the
first one, assuming that the solution will make the setting of font size
and alignment resolves, I'll use early binding. But I think without the
object library registered it won't work anyway.

Ideas?

MTIA

Rocky


More information about the AccessD mailing list