Zum Hauptinhalt gehen

Suche

Suche

How To Split Data From One Data Source Into 2 Different Text Objects?

Kommentare

1 Kommentar

  • Avatar
    Vorname Nachname

    A little late but I found a way to split it with a VBS Script.

    We had a serial number to split into four different Barcode-Fields in the layout.

    So we made a script into the "OnPrintJobStart"-Event in the Script Editor.

    This script splitted our Serial Number, coming from a CSV-File as 123,321,213,221 into four different fields with Data Sources sn1, sn2, sn3 and sn4.

    Here the script:

    on error resume next
    Dim strSerial, strArray
    strSerial = Format.NamedSubStrings("Serialnummern").Value
    ' msgbox strSerial
    strArray = Split(strSerial,",")
    For i = 0 to Ubound(strArray)
    'msgbox "Durchlauf " & i & " " & strArray(i)
    Format.NamedSubStrings("Sn"&(i+1)).Value = strArray(i)
    'msgbox "Sn" & (i+1) & " " & Format.NamedSubStrings("Sn"&(i+1)).Value
    Next

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.