Code:
Issue:
Whenever I try to print a range, I receive the following error message:
I have checked Help and it shows my types to be correct. My google results just say a type is wrong but don't give anything more specific. If I use the "PrintOut" command with no parameters, it works fine.
Any help would be greatly appreciated.
VB.NET:
Public Function PrintDocument(ByVal pageFrom As Object, ByVal pageTo As Object, _
Optional ByVal displayErrorMessage As Boolean = True) As PrintReturns
Try
wrdApp.ActiveDocument.PrintOut(, , WdPrintOutRange.wdPrintFromTo, , pageFrom, pageTo, WdPrintOutItem.wdPrintDocumentContent, , , , , , , , , , , )
PrintDocument = PrintReturns.Ok
Catch ex As Exception
If displayErrorMessage Then
MessageBox.Show(ex.Message)
End If
PrintDocument = PrintReturns.pError
End Try
End Function
Issue:
Whenever I try to print a range, I receive the following error message:
Type Mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
I have checked Help and it shows my types to be correct. My google results just say a type is wrong but don't give anything more specific. If I use the "PrintOut" command with no parameters, it works fine.
Any help would be greatly appreciated.
Last edited: