Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. Option Explicit
  2. Dim Global_WinUser
  3. DIM GVZNummerGlobal
  4. DIM parentBatch
  5.  
  6. Function DPM_OnCreate(DCRoot)
  7. Global_WinUser = DCRoot.GetUser()
  8. End Function
  9.  
  10.  
  11. Function DPM_OnOpenBatch(DCBatch)
  12. End Function
  13.  
  14.  
  15. Function DPM_OnProcessDocument(DCDocument)
  16. '1. Anzahl Seiten auslesen und setzten
  17. DIM nPage
  18. nPage = "Anzahl Seiten: " & DCDocument.GetPageCount()
  19. DCDocument.SetAttribute "doc_text_1", nPage
  20.  
  21. 'Scanuser voransetzten
  22. DIM ScanUser
  23. ScanUser = "Scan User: " & Global_WinUser
  24. DCDocument.SetAttribute "doc_text_2", ScanUser
  25.  
  26. '4. Prüfe ob die bestehende GVZ-Nr ungleich der eingegebene ist
  27. DIM GVZNr, firstDocument, firstGVZNr 'aktuelle GVZ-Nummer welche im Feld GVZ-Nummer steht
  28. GVZNr = DCDocument.GetAttribute("doc_field_1")
  29.  
  30. Set parentBatch = DCDocument.GetParent()
  31. Set firstDocument = parentBatch.GetDocument(0)
  32.  
  33. firstGVZNr = firstDocument.GetAttribute("doc_field_1")
  34.  
  35. IF(GVZNummerGlobal = "") THEN
  36. IF(GVZNr <> "") THEN
  37. GVZNummerGlobal = GVZNr
  38. DCDocument.SetAttribute "doc_field_1", GVZNummerGlobal
  39. ELSEIF(GVZNr = "") THEN
  40. GVZNummerGlobal = ""
  41. END IF
  42. END IF
  43.  
  44. IF(GVZNummerGlobal <> "") THEN
  45. IF(GVZNummerGlobal = firstGVZNr) THEN
  46. DCDocument.SetAttribute "doc_field_1", GVZNummerGlobal
  47. ELSEIF(GVZNummerGlobal <> firstGVZNr) THEN
  48. GVZNummerGlobal = firstGVZNr
  49. DCDocument.SetAttribute "doc_field_1", GVZNummerGlobal
  50. END IF
  51. END IF
  52.  
  53. 'Dokument wieder validieren
  54. DCDocument.SetValidate(1)
  55.  
  56. End Function
  57.  
  58.  
  59. Function DPM_OnCloseBatch()
  60. End Function
  61.  
  62.  
  63. Function DPM_OnDestroy()
  64. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement