Dim pDraft As SAPbobsCOM.Documents
Set pDraft = vCmp.GetBusinessObject(oDrafts)
Dim pOrder As SAPbobsCOM.Documents
vCmp.XmlExportType = xet_ExportImportMode
vCmp.XMLAsString = False
pDraft.GetByKey (3)
pDraft.SaveXML ("c:\drafts.xml")
'Here you should add a code that will change the Object's
'value from 112 (Drafts) to 17 (Orders) and also you should
'remove the DocObjectCode node from the xml. You can use any
'xml parser.
'
'Create a new order
Set pOrder = vCmp.GetBusinessObjectFromXML("c:\drafts.xml", 0)
pOrder.Add