program AutoExec; var S, S2 : string[90]; begin if Strtrim(GetCommandLine) <> "" then Halt; { neco je na prikazove radce -> nic neprovadet } ErasethisMacro; { - to nejlepe co nejdrive, aby to pripadny break neovlivnil } Wait_box_show("Čekejte prosím", "Otevírám dokument CTIMNE.WPD"); S:= DefaultDocDir; S2:="CTIMNE.WPD"; if StrLength(S) > 0 then if S[StrLength(S)] <> '\' then S:=Strcat(S, "\"); S:=Strcat(S, S2); if OpenFile(false, S, ftWT_30, ctWINEE) = IDOK { úspěsně otevřen -> neotvírej implicitní prázdny dok. } then begin Wait_box_hide; SetInitialOpen(FALSE) end { neotevřen -> informace o chybě : } else begin Wait_box_hide; S:= "Nelze otevřít " + S; Info_box("Chyba za běhu makra", S); end; end.