Skip to Content
avatar image
Former Member

Print Crystal Report (2013) from Word 2010 Macro

Hello, I want to create a macro in Word 2010 that passes parameters and prints a Crystal Reports 2013 report (rpt file is local on the machine). I have searched and searched and have not been able to find documentation of the code I could use to call the Crystal Report from VBA. I tried this:

Sub Print_Patient_Draft_Report2()
' Print_Patient_Draft_Report2 Macro
Dim CR As New CRAXDRT.Application
Dim rep As CRAXDRT.Report
Set rep = crxApp.OpenReport("C:\TestReport\PatientDraftReport.rpt")
rep.ParameterFields(1).AddCurrentValue "*"
rep.ParameterFields(2).AddCurrentValue "*"
rep.ParameterFields(3).AddCurrentValue "*"
rep.ParameterFields(4).AddCurrentValue "*"
rep.ParameterFields(5).AddCurrentValue "*"
rep.ParameterFields(6).AddCurrentValue "PD-17-00111"
rep.PrintOut promptUser:=False, numberOfCopy:=1 ' promptUser:=True doesn't work
End Sub

But get a runtime error 424 on the OpenReport line.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 15, 2017 at 05:27 PM

    You are using the RDC which is no longer shipped or supported since CR XI R2.

    We no longer have a SDK that can be used directly in Word. You could write one using the .NET SDK from here:


    Add comment
    10|10000 characters needed characters exceeded