G
Guest
I've created a documentation database for documenting Health Systems
interfaces in a 22 hospital organization. The nterface folks fill out a MS
Word document based on a MS Word tempate I created. From Access I have the
below code. The code generates a R$un time error, NOT deferred by ON ERROR
RESUME NEXT, "429" "ActiveX can't create Object". Anyone have any ideas on
this? I've tried everything I can think of. My code is right out of the help
files with needed adjustments... Any help would be appreciated
Private Sub Command239_Click()
Dim Pptr As Object, cntr1 As Integer, cntr2 As Integer, Tptr As Object
Dim filpth As String, FileName As String, Fullpth As String, prop As Variant
Dim WordWasNotRunning As Boolean ' Flag for final release.
DoCmd.OpenForm "Word Import", acNormal, , , acFormEdit, acDialog
filpth = Forms![BldReportFrm].pthstring
FileName = Forms![BldReportFrm].FileName
Fullpth = filpth & "\" & FileName
On Error Resume Next ' Defer error handling.
Set Pptr = GetObject(, "Word.Application")
If Err.Number <> 0 Then
WordWasNotRunning = True
End If
Err.Clear ' Clear Err object in case error occurred.
'Check for Microsoft Word. If Microsoft Word is running,
'enter it into the Running Object table.
DetectWord
Set Pptr = GetObject(Fullpth)
interfaces in a 22 hospital organization. The nterface folks fill out a MS
Word document based on a MS Word tempate I created. From Access I have the
below code. The code generates a R$un time error, NOT deferred by ON ERROR
RESUME NEXT, "429" "ActiveX can't create Object". Anyone have any ideas on
this? I've tried everything I can think of. My code is right out of the help
files with needed adjustments... Any help would be appreciated
Private Sub Command239_Click()
Dim Pptr As Object, cntr1 As Integer, cntr2 As Integer, Tptr As Object
Dim filpth As String, FileName As String, Fullpth As String, prop As Variant
Dim WordWasNotRunning As Boolean ' Flag for final release.
DoCmd.OpenForm "Word Import", acNormal, , , acFormEdit, acDialog
filpth = Forms![BldReportFrm].pthstring
FileName = Forms![BldReportFrm].FileName
Fullpth = filpth & "\" & FileName
On Error Resume Next ' Defer error handling.
Set Pptr = GetObject(, "Word.Application")
If Err.Number <> 0 Then
WordWasNotRunning = True
End If
Err.Clear ' Clear Err object in case error occurred.
'Check for Microsoft Word. If Microsoft Word is running,
'enter it into the Running Object table.
DetectWord
Set Pptr = GetObject(Fullpth)