Link to home
Start Free TrialLog in
Avatar of jack niekerk
jack niekerkFlag for Netherlands

asked on

FROM VB6 PRINTING A TXT FILE WITH WORDPAD AUTOMATICLY

I create in VB6  flat ascci text file (finacial report)
Found out then using wordpad fontype Courier or Lucida Console will
keep my text nicely lined out

In the program now I use:
 ret = ShellExecute(Me.hwnd, "Open", FileName$, 0&, 0&, SWSHOWNORMAL)
works ok, now user can have wrong fonttype selected, and has to set sometimes
output to landscape.

So, looking for a command or shell or anything to skip the user need,
and print the file right away with set e.g. landscape or potrait and fonttype/size
Avatar of aikimark
aikimark
Flag of United States of America image

why not print it with notepad?  Notepad defaults to courier
Avatar of jack niekerk

ASKER

true, but still want to make a 'call'    for the whole printe proces
What is the file extension?
Well , create file in software by myself , so could be any type,  use now .txt
by default, the program associated with .txt files is notepad.  When you print a txt file, it should open it with Notepad, send it to the default printer and close Notepad.
Print example:
 ret = ShellExecute(Me.hwnd, "Print", FileName$, 0&, 0&, SWSHOWNORMAL)

Open in new window

Ok, but can I send somehow in thsi command, fonttype to use and either to use landscape and/or portrait?
Or set somehow  (registry ??)  upfront what  notepad should use ?
why change the font type?
well , the file is flat ascci, does not contain info how to print
the default used fonttype for user station could be to large to print file fitting on paper.
(plus either landscape or portrait)
ASKER CERTIFIED SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The registry settings for Notepad's iPointSize value are synced with the application.  This is a font size times ten value. So, a 12 point font specification in Notepad would be a 120 value (x78) in the registry.