VB6: How to set margins when exporting to Excel or Word?
Since I can't manage to print in VB6 with high quality (with every code I try, the printing looks pixelated and grey)... I resolved to export:
* via RichTextBox, to Microsoft Word
(.SaveFile FileName, and then opening it in Word via Shell)
* via SpreadSheet, to Microsoft Excel
(.Export FileName, and then opening it in Excel via Shell)
...the thing is I don't know:
a) how to set the margins
b) how to tell Word and Excel to print automatically, without the user having to click "print"
Does anyone knows how?
Thanks.
Re: VB6: How to set margins when exporting to Excel or Word?
a, you would need to automate either excel or word, though you may be able to set the margins in the rtbox
b, if you are automating either you can just use the appropriate printout method
or you can use shellexecute for the filename, with the print verb, which will print the file with the default application