Since VB2005 has such awkward printing facilities, I've taken to writing to MS Wordpad. (I build up a report in a richtextbox, save it to an rtf file, and open it in word pad using Shell.) However, to adjust things like margins, page-orientation, etc., I need to 'sendkeys' to wordpad. I'd much prefer to address these properties more directly if I could.
Anyone know how I'd identify any exposed properties of WordPad (or any other MS application) and set them in program code?
What I'm looking for is something roughly like this:
dim WPh = Shell("Wordpad.exe x.rtf") '== Load file 'x'; may need DoEvents
WPh.MarginLeft = 0.70 '== Set left margin
WPh.Orientation = 1 '== assume 0/1= Portrait/Landscape
WPh.FileMenu.PrintPreview '== whatever ...
I'm grateful for some help.
J. S. Schiavo
Missouri Southern State University