Dlg.OPEN('Preparing Document...'); IF ISCLEAR(BullZipPDF) THEN CREATE(BullZipPDF); FileDirectory := ENVIRON('TEMP') + '\' {Text001}; FileName := xFileName; IF EXISTS(FileDirectory+FileName) THEN IF NOT ERASE(FileDirectory+FileName) THEN FileName := FORMAT(TODAY, 0, '<day><month><year>') + FORMAT(TIME, 0, '<Hours24><Minutes,2><Seconds>') + xFileName; BullZipPDF.Init; BullZipPDF.LoadSettings; RunOnceFile := BullZipPDF.GetSettingsFileName(TRUE); BullZipPDF.SetValue('Output',FileDirectory+FileName); BullZipPDF.SetValue('Showsettings', 'never'); BullZipPDF.SetValue('ShowPDF', 'no'); BullZipPDF.SetValue('ShowProgress', 'no'); BullZipPDF.SetValue('ShowProgressFinished', 'no'); BullZipPDF.SetValue('SuppressErrors', 'yes'); BullZipPDF.SetValue('ConfirmOverwrite', 'no'); BullZipPDF.WriteSettings(TRUE); TimeOut := 0; WHILE EXISTS(RunOnceFile) AND (TimeOut < 10) DO BEGIN SLEEP(100); //was 1000. TimeOut := TimeOut + 1; END; Dlg.CLOSE; EXIT(FileDirectory+FileName);
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.