VBA/Excel/Access/Word/XML/XML Export

Материал из VB Эксперт
Перейти к: навигация, поиск

Exporting an Access Report to an XML Data File with ASP

 
Sub Export_InvoiceReport() 
     Application.ExportXML ObjectType:=acExportReport, _ 
                 DataSource:="Invoice", _ 
                 DataTarget:="C:\Invoice.xml", _ 
                 PresentationTarget:="C:\Invoice.xsl", _ 
                 ImageTarget:="C:\Learn_XML", _ 
                 WhereCondition:="OrderID=11075" 
End Sub



Exporting Multiple Tables to an XML Data File

 
Sub Export_CustomerOderDetails()
    Dim objOtherTbls As AdditionalData
    On Error GoTo ErrorHandle
    Set objOtherTbls = Application.CreateAdditionalData
    objOtherTbls.Add "Employees"
    objOtherTbls.Add "Products"
    Application.ExportXML ObjectType:=acExportTable, _
                DataSource:="Customers", _
                DataTarget:="C:\Details.xml", _
                AdditionalData:=objOtherTbls
Exit_Here:
        Exit Sub
ErrorHandle:
        MsgBox Err.Number & ": " & Err.Description
        Resume Exit_Here
End Sub