Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print Document from WordPad

Status
Not open for further replies.

jche

Programmer
Nov 5, 2002
4
SG
Hi there
I need to automate the printing of wordpad documents using VB. The following code is what I have written :-

Dim filename As String
Dim wp As String
Dim actApp As String


filename = "test1.txt"
wp = "c:\wordpad.exe c:\MyDocuments\" + filename
Shell wp

' to change focus to WordPad app
actApp = filename + " - WordPad"
AppActivate actApp

I believe the above will make the wordpad application window active. But what do I do next print the document from here?

I need to open up the document in order to print becoz the document contains Chinese characters. So I need to open up the document so that a Chinese translator software at my PC will display them correctly before printing. Pls help and advise. Thanks alot for your kind attention.

Rgds
jche...
 
as far as I know Wordpad doesn't support DDE nor OLE. So you could use Sendkeys to control printing in Wordpad:
Code:
SendKeys "^p{ENTER}", True
It doesn't seem that p is language dependent... but you can never know for sure... So be aware of this possible problem...

Hope this helps
Andreas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top