Hi Douglas,
this is the code that I use a document throught the DI API :
Dim RetVal AsLong
Dim ErrCode AsLong
Dim ErrMsg AsString
Dim vOrder As SAPbobsCOM.Documents
Set vOrder = vCmp.GetBusinessObject(oOrders)
'Retrieve the document record to close from the database
RetVal = vOrder.GetByKey(DocEntry)
If RetVal <> 0 Then
vCmp.GetLastError ErrCode, ErrMsg
MsgBox "Failed to Retrieve the record "& ErrCode & " "& ErrMsg
ExitSub
EndIf
'Close the record
RetVal = vOrder.Close
If RetVal <> 0 Then
vCmp.GetLastError ErrCode, ErrMsg
MsgBox "Failed to Close the document"& ErrCode & " "& ErrMsg
EndIf
EndSub