[Migrated content. Thread originally posted on 07 January 2005]
Guys,Can you please look at this and tell me why it doesn't work?
Basically it seems to change to font size ok, but I can't seem to figure out how to change the font type.
Many Thanks,
Shaun
IF OS-IS-WIN-FAMILY
CALL "WIN$PRINTER"
USING WINPRINT-SETUP
GIVING WS-RESULT
IF WS-RESULT = 1
INITIALIZE WFONT-DATA
SET WFDEVICE-WIN-PRINTER TO TRUE
SET WFCHARSET-DEFAULT TO TRUE
SET WFFAMILY-MODERN TO TRUE
MOVE "Courier New" TO WFONT-NAME
MOVE 07 TO WFONT-SIZE
CALL "W$FONT" USING
WFONT-GET-CLOSEST-FONT
TEXT-FONT WFONT-DATA
GIVING WS-RESULT
INITIALIZE WPRTDATA-SET-FONT
MOVE TEXT-FONT TO WPRTDATA-FONT
CALL "WIN$PRINTER" USING
WINPRINT-SET-FONT
WINPRINT-DATA
GIVING WS-RESULT
ELSE
PERFORM CLOSE-FILES
EXIT PROGRAM
END-IF
END-IF.