|
-
Jul 27th, 2006, 08:50 AM
#1
Thread Starter
Lively Member
SendDlgItemMessage overflow
Hello,
I'm using the following code to automatically print a file to some other file:
Call ShellExecute(0, "print", sFile, "", "", SW_HIDE)
hwnd = FindWindow(vbNullString, "Print To File")
Do While hwnd = 0
hwnd = FindWindow(vbNullString, "Print To File")
DoEvents
Loop
If hwnd <> 0 Then
iii = SendDlgItemMessage(hwnd, 1152, WM_SETTEXT, 0, aFile)
iii = SendMessage(hwnd, WM_SHOWWINDOW, 0, 0)
lObjhWnd = FindWindowEx(hwnd, 0, "Button", "OK")
iii = SendMessage(lObjhWnd, BM_CLICK, 0, 0)
DoEvents
End If
aFile is the file I want to print to. So basically what I do is that I send a file to the printer with the ShellExecute command, the files application opens, and then I wait until the "Print to File" dialog box appears (I'm using a file printer) and then the program should write the outputfile name and press the OK button on that dialog box. That's the idea though...but it doesn't work 
I get an "Run time error 6 - Overflow" on the SendDlgItemMessage line. Any idea on what it might be?
Thanks in advance!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|