Greetings, I'm new here, and don't claim to know either Access or VBA that well.... I've beem researching a problem with a mail-merge function of the application:
- IF the merge process is started and WORD is already running, it fails.
Is it possible to determine programatically if word is running and error out gracefuly?
Research seems to indicate it should be possible.
BUT in fact attempting to execute found code samples either fails outright, or more consistently generates an ActiveX error:
Run-time error '429':
ActiveX component can't create object
Exploration on the error, (
http://support.microsoft.com/kb/828550) doesn't appear to apply???
- checked the versions of the oleautomation files. all match.
- not attempting to CREATE anything, rather merely check existence...
Frustrating.
Sample failed code on button:
Code:
On Error Resume Next
MsgBox Str((GetObject(, "Word.Application"))) ' Triggers error
Dim oWordApp As Word.Application
Dim oDoc As Word.Documen
Set oApp = GetObject(, "Word.Application")
If Err Then
MsgBox ("Word IS NOT RUNNING, or walking...")
Else
MsgBox ("Word IS RUNNING")
End If
Any suggestions / hints / tips / pointers / moral support would be appreciated.
Thanks!
John