Add_ReferencedFile

Methode (Function) · gibt Boolean zurück

Add_ReferencedFile ist eine Methode der Klasse Aloaha_ZUGFeRD.XML im Aloaha ZUGFeRD SDK.

Beschreibung (aus der SDK-Dokumentation): Embeds a file from disk (Base64) as an additional referenced document of a line item (ram:AdditionalReferencedDocument in the line trade agreement). Only ReferencedFileType LineItem_AdditionalReferencedDocument is currently stored. Always sets the profile to Extended.

Rückgabe: Always False in the current implementation; check LastError (e.g. "FilePath does not exist", "File is empty") to detect problems.

Hinweis: The issue date stored with the attachment is taken from the Document_Date property.

Deklaration

Public Function Add_ReferencedFile(ByVal ReferencedFileType As iXML.WhichReferencedFile, ByVal PositionNO As Long, ByVal FilePath As String, ByVal IssuerAssignedID As String, ByVal URIID As String, ByVal LineID As String, ByVal TypeCode As String, Optional ByVal Name As String = "", Optional ByVal ReferenceTypeCode As String = "", Optional ByVal IssueDateTime As String = "", Optional ByVal Document_DateFormat As String = "", Optional ByVal MimeType As String = "") As Boolean

Parameter

NameTypPflichtBeschreibung
ReferencedFileTypeiXML.WhichReferencedFileerforderlichTarget of the referenced file; currently only LineItem_AdditionalReferencedDocument is processed
PositionNOLongerforderlichZero-based index of the line item
FilePathStringerforderlichFull path of the file to embed (must contain a backslash and exist)
IssuerAssignedIDStringerforderlichIdentifier of the referenced document
URIIDStringerforderlichExternal document location
LineIDStringerforderlichReferenced line ID
TypeCodeStringerforderlichDocument type code; defaults to 916 if empty
NameStringoptional (Standard: "")Description of the document; defaults to the file name without extension
ReferenceTypeCodeStringoptional (Standard: "")Reference type code / scheme identifier
IssueDateTimeStringoptional (Standard: "")Document date, e.g. YYYYMMDD; if empty, the date format is set to 102
Document_DateFormatStringoptional (Standard: "")Date format code, e.g. 102
MimeTypeStringoptional (Standard: "")MIME type of the file; looked up from the Windows registry by file extension if empty

Aufruf (VB.NET)

Dim alo As New Aloaha_ZUGFeRD.XML(Aloaha_ZUGFeRD.iXML.ZUGFeRDProfile.comfort, False, LicenseKey)
' …
Dim ergebnis = alo.Add_ReferencedFile(ReferencedFileType, PositionNO, FilePath, IssuerAssignedID, URIID, LineID, TypeCode)

Artikel mit Add_ReferencedFile

COM-Schnittstelle

Add_ReferencedFile ist Mitglied der Schnittstelle Aloaha_ZUGFeRD.iXML (Position 170 von 328) und damit auch aus VB6, VBA/Access und anderen COM-Clients über CreateObject("Aloaha_ZUGFeRD.XML") aufrufbar. Neue Mitglieder werden immer am Ende von iXML angefügt, damit bestehende COM-Clients unverändert weiterlaufen; nach einem Update die Typbibliothek neu registrieren.

Quelle: XML-Dokumentationskommentare des Aloaha ZUGFeRD SDK (xml.vb). Gleiche Signatur in VB6/VBA über COM; in C# mit Semikolon.