Print Purchase Order Paperless Office

I am trying to use BOI tp print PO to paperless office and I am having hard time finding any good examples of printing to paperless.

Does anyone have code for printing of any forms or reports to paperless?

My goal is to email PDF copy of purchase order with BOI.


Thanks in advance

  • This is snapshot my code. If anyone can advice on paperless printing file please do so.

    If Not SetSession("P/O", "PO_PurchaseOrderPrinting_ui") Then

                   Debug.Print("Set Session PO_PurchaseOrderPrinting_ui " & oSS.sLastErrorMsg & vbCrLf)

                   GoTo CLEANUP

    End If

    oPOOrderPrint = oScript.NewObject("PO_PurchaseOrderPrinting_rpt", oSS)

    oSS.nTerminateUI()

    oPOOrderPrint.nSetKeyValue("ReportSetting$", "STANDARD")

    oPOOrderPrint.nSetKeyValue("RowKey$", "1")

    oPOOrderPrint.nSetKey()

    oPOOrderPrint.nSetValue("SelectField$", "Order Number")

    oPOOrderPrint.nSetValue("SelectFieldValue$", "Order Number")

    oPOOrderPrint.nSetValue("Tag$", "TABLE=PO_PurchaseOrderHeader; COLUMN=PurchaseOrderNo$")

    oPOOrderPrint.nSetValue("Operand$", "=")

    oPOOrderPrint.nSetValue("Value1$", strPONumber)

    retVAL = oPOOrderPrint.nWrite()

    If retVAL = 0 Then

    Debug.Print("oPOOrderPrint.nWrite Exception  " & oPOOrderPrint.sLastErrorMsg & vbCrLf)

    End If

    'Set Paperless options - THIS IS WHERE I HAVE ISSUES

    oPaperless = oScript.NewObject("PL_FormCommon_ui", oSS, oPOOrderPrint.ncoPLCommon)

    retVAL = oPaperless.nSetValue("FormPrintUISelection$", "7")

    'retVAL = oPaperless.nFormPrintUISelection = "7" '

    If retVAL = 0 Then

    Debug.Print("Print Exception  " & oPaperless.sLastErrorMsg & vbCrLf)

    End If

    retVAL = oPOOrderPrint.nProcessReport("Print")

    If retVAL = 0 Then

    Debug.Print("Print Exception  " & oPOOrderPrint.sLastErrorMsg & vbCrLf)

    End If

    oPaperless.DropObject()

    oPOOrderPrint.DropObject()