hi all
i am working on a application writen in vb6 (winXP PRO). in this appl. my users pull reports from an MS access db into a MSflexGrid. if they click on a supplier in the supplier column, a purchase order form appears. this form must be sent by fax. the supplier's details (fax number, contact person ets.) are read from the db and inserted into textboxes.
the fax will be sent to a RICOH Africio 2018D RPCS printer with a LAN_FAX M4
driver. i want to know if it's possible to send the supplier's details from my appl. to the dialog box that appears when you print after selecting LAN-Fax as the printer. so that faxing is made a bit easier.
pls...help
i don't realy know much about vb6
3 4775
Did you find out how to do this? I'm trying to do it in VB .net
hi all
i am working on a application writen in vb6 (winXP PRO). in this appl. my users pull reports from an MS access db into a MSflexGrid. if they click on a supplier in the supplier column, a purchase order form appears. this form must be sent by fax. the supplier's details (fax number, contact person ets.) are read from the db and inserted into textboxes.
the fax will be sent to a RICOH Africio 2018D RPCS printer with a LAN_FAX M4
driver. i want to know if it's possible to send the supplier's details from my appl. to the dialog box that appears when you print after selecting LAN-Fax as the printer. so that faxing is made a bit easier.
pls...help
i don't realy know much about vb6
Did you find out how to do this? I'm trying to do it in VB .net
no, not the way i wanted to.........but i used the clipboard.settext function
to copy the number to the clipboard and then my users, after fax machine has been selected, click in the txt box where the number is requested and press
ctrl + v or r-click and paste......
good luck
spider1916
I realize this is an old post, but this may help others in search of an answer...
In VB 5/6, code execution is halted whenever a fax/printer dialog box is opened. Once the printer dialog box is closed, execution resumes. In order to populate the dialog box, a background worker thread is needed. In VB.net this is no problem, but in VB5/6, I chose to create a "worker program" that is launched (with the fax number as a command line argument) just prior to opening the printer/fax dialog.
The worker program simply watches for the fax/printer dialog box to be opened. The worker program than inserts the fax number, sends the fax and closes the dialog box. As soon as the dialog box is closed, the main program resumes execution. In VB.net, a background worker thread can run even though the main code is halted by the printer dialog box. This worker thread can enter the fax number and close the dialog box. - 'Worker thread or exe to find the printer/fax dialog box
-
'locate the fax number input box, enter the fax number
-
'locate the "send" button and send.
-
'Thanks to 'URL: http://www.allapi.net/
-
'For help with the APIs E-Mail: KPDTeam@Allapi.net
-
-
-
'********* WORKERTHREAD.EXE Module *********
-
Const SW_SHOWNORMAL = 1
-
Const KEYEVENTF_KEYUP = &H2
-
Const INPUT_KEYBOARD = 1
-
-
Private Type KEYBDINPUT
-
wVk As Integer
-
wScan As Integer
-
dwFlags As Long
-
time As Long
-
dwExtraInfo As Long
-
End Type
-
Private Type GENERALINPUT
-
dwType As Long
-
xi(0 To 23) As Byte
-
End Type
-
-
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
-
Private Declare Function SendInput Lib "user32.dll" (ByVal nInputs As Long, pInputs As GENERALINPUT, ByVal cbSize As Long) As Long
-
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)
-
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
-
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
-
-
-
Sub Main()
-
'FAX NUMBER SHOULD BE VERIFIED/QUALIFIED BEFORE COMING HERE!
-
Dim FaxNumber As String
-
If VB.App.PrevInstance = True Then End
-
FaxNumber = Command()
-
-
Dim WinWnd As Long, TheVal As Long
-
'Get Handle for desired GUI - search for the form's caption
-
While WinWnd = 0
-
DoEvents
-
WinWnd = FindWindow(vbNullString, "PC-FAX")
-
'"PC-FAX" is my printer/fax dialog box caption.
-
'Change this string to match your dialog box caption!
-
Wend
-
'make the GUI window form active
-
TheVal = SetForegroundWindow(WinWnd)
-
'Need time to process ?
-
Sleep 10
-
Dim Count As Integer
-
'send 5 tabs to get to the GUI FAX number input box
-
'Change this number to suit your needs!
-
For Count = 1 To 5
-
Sleep 10
-
SendKey CByte(9)
-
DoEvents
-
Next Count
-
'send the fax number to the GUI fax number input box
-
'sending one character at a time
-
For Count = 1 To Len(FaxNumber)
-
Sleep 10
-
SendKey CByte(Asc(Mid(FaxNumber, Count, 1)))
-
DoEvents
-
Next Count
-
'send three more tabs to get to the GUI SEND button
-
'Again, change the number of tabs to suit your needs!
-
For Count = 1 To 3
-
Sleep 10
-
SendKey CByte(9)
-
DoEvents
-
Next Count
-
'send ENTER to send the fax
-
SendKey CByte(13)
-
-
End Sub
-
-
-
-
Public Sub SendKey(bKey As Byte)
-
'Thanks to 'URL: http://www.allapi.net/
-
'For help with the APIs E-Mail: KPDTeam@Allapi.net
-
-
Dim GInput(0 To 1) As GENERALINPUT
-
Dim KInput As KEYBDINPUT
-
KInput.wVk = bKey 'the key we're going to press
-
KInput.dwFlags = 0 'press the key
-
'copy the structure into the input array's buffer.
-
GInput(0).dwType = INPUT_KEYBOARD ' keyboard input
-
CopyMemory GInput(0).xi(0), KInput, Len(KInput)
-
'do the same as above, but for releasing the key
-
KInput.wVk = bKey ' the key we're going to realease
-
KInput.dwFlags = KEYEVENTF_KEYUP ' release the key
-
GInput(1).dwType = INPUT_KEYBOARD ' keyboard input
-
CopyMemory GInput(1).xi(0), KInput, Len(KInput)
-
'send the input now
-
Call SendInput(2, GInput(0), Len(GInput(0)))
-
End Sub
The main program can then launch the worker exe similar to this... - 'execution stops until fax dialog is closed
-
'so launch app to enter number and send fax
-
Dim FaxNumber as String
-
FaxNumber = "15555555555"
-
Shell ("C:\MyPrograms\WorkerThread.exe" & " " & FaxNumber)
-
'Launch your fax job dialog box
-
MyExcel.ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:="KONICA MINOLTA bizhub 20 (FAX) on Ne01:"
-
'Code resumes after WorkerThread.exe finishes it's job
Sign in to post your reply or Sign up for a free account.
Similar topics
by: rodchar |
last post by:
hey all,
is there a way to bring up the printer dialog (File/Print) thru code in
asp.net?
thanks,
rodchar
|
by: Tommy Martin |
last post by:
I would like to bring up the printer dialog before my report is sent to the
printer to allow the user to select another destination and possibly the
number of copies.
Can anyone steer me in the...
|
by: MIS |
last post by:
Dear all
I need to hidden dailog box printer on vb.net , How can i do ?
Brg ,
Tingnong
|
by: pamelafluente |
last post by:
I am doing my own PrintDialog, and have placed there a combo with the
printer names, as in the PrintDialog provided by VB.NET.
Here is the question: how do I open the native windows printer...
|
by: Diego |
last post by:
How do I capture a cancel event of Printer dialog box?
Regards,
Diego
|
by: Tim Marshall |
last post by:
A2003
Most of the time, in past apps, my report routines are usually a preview
first and then DoCmd.RunCommand acCmdPrint for the printer dialog.
However, I'm now faced with wanting to send a...
|
by: mehdi_mousavi |
last post by:
Hi folks,
has got a button, that enabled user whether to send some sort of data
(when an application crashes) to Microsoft. I would like to know that
is there anyway to incorporate this...
|
by: Marco Bonifazi |
last post by:
Hello!
I have a file (in my situation it is a Postscript file or a Pdf file,
but it isn't important).
I must send this file to a printer, using Python, and I need to select
the printer to...
|
by: tsubasa |
last post by:
I am working on a web page that allows a user to review orders that are pending approval. If the user approves the order it will print the order then run an asp page to close the order after it has...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |