printing via a macro

printing via a macro

3
NewbieNewbie
3

    Jan 25, 2005#1

    Hi,

    We have a large number of files that have to be converted from OEM -> ANSI and then printed. We have a macro to take care of the conversion, but are struggling to understand how we can print to the default printer with a macro.

    I know that I could open Ultraedit twice - once to run the macro and a second time to print, but the number of files that we need to process makes this rather impractical.

    Could someone please offer some advice?


    Regards,

    Cranberry

    6,687587
    Grand MasterGrand Master
    6,687587

      Jan 25, 2005#2

      I never tried, but maybe you can do that with the command line options of UltraEdit. Try

      "C:\Program Files\UltraEdit\uedit32.exe" "your file with path" /M,1="full path of macro file/macro name" /p

      Hope it runs the macro before printing. If this doesn't work, first convert all files. Then select all files in explorer, press right mouse button and select print. If you have registered the file extension to UltraEdit for open AND print, all files will be printed with UltraEdit.
      Best regards from an UC/UE/UES for Windows user from Austria

      3
      NewbieNewbie
      3

        Jan 25, 2005#3

        Mofi,

        I've tried calling the macro along with the /p command from the command line, and that doesn't work, neither does setting the macro to autoload and look for a specific file name, and then calling

        Code: Select all

        Uedit32 <filename> /p
        Manual intervention is not possible for this either, as there's a script checking our mainframe and writing these files to a local PC when new data arrives. It's got to be totally hands-off for the user.[/code]

        6,687587
        Grand MasterGrand Master
        6,687587

          Jan 26, 2005#4

          Different approach to the problem - print without converting OEM to ANSI.

          At our company we still have to edit and print files in OEM format. So I created an UltraEdit ini-file specially for this files. All characters with a different hex code in OEM are displayed and printed correct (German umlauts ä, ö, ü, ... for example) although they are still saved in OEM format. No conversation is done manually.

          You could to the same. Create an ini-file for your OEM files and use this ini-file and the /p option on command line to print the OEM file without conversation but with correct character signs.

          The differences in the ini-file for the special OEM working version are (first line is ANSI setting, second the OEM setting):

          [Settings]
          ConvertKBDInput=0
          ConvertKBDInput=1
          Force OEM=0
          Force OEM=1

          [Font]
          CharSet=0
          CharSet=255

          [FixedFont]
          CharSet=0
          CharSet=255

          [PrintFont]
          CharSet=0
          CharSet=255

          I also increased the size of the fonts in the OEM version, because our old OEM files do not contain more than 77 characters per line and I also changed the background color in the OEM version to a different color, so we can easily see, if the actual instance is for ANSI or OEM.

          You also have to enable multiple instances in both ini-files (standard ANSI and special OEM) or you risk a settings mismatch if you open UltraEdit standard while the OEM version is currently running and vice versa.

          Now you can use the command
          uedit32 "your file" /I="path to ueditoem.ini\ueditoem.ini" /P

          To all other interested users:
          It is even possible to assign the special OEM ini-file to file extensions, so when you double click on a file in old OEM code, automatically UltraEdit with the OEM-ini-file is loaded.

          Example registry entries for this:

          [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.oem]
          @="UltraEdit-32 OEM"

          [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\UltraEdit-32 OEM]

          [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\UltraEdit-32 OEM\shell]

          [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\UltraEdit-32 OEM\shell\open]

          [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\UltraEdit-32 OEM\shell\open\command]
          @="\"C:\\Program Files\\UltraEdit\\Uedit32.exe\" \"%1\" /I=\"C:\\Programs Files\\UltraEdit\\ueditoem.ini\""
          Best regards from an UC/UE/UES for Windows user from Austria

          3
          NewbieNewbie
          3

            Jan 26, 2005#5

            Mofi,

            thanks, that looks interesting, I'll give it a try.


            Cranberry