DPM
2010-04-19 04:48:48 UTC
Hi,
ShellExcute is used to print to a given printer as follows from VFP9.
DECLARE LONG ShellExecute IN "shell32.dll" LONG nHandle, STRING cOperation,
STRING cFile, ;
STRING vParameters, STRING cDirectory, LONG nShowCmd
lnSuccess = ShellExecute(0, "PRINTTO", "C:\Test.Txt", '"Printer Name"', "",
1)
This works fine.
But the problem is when the name of the printer has a double quote("), it
does not print.
The following does not work.
eg. Assume the name of the printer is '"Printer "Name"' as the parameter
passed into ShellExecute()
=> Using 2 or 3 double quotes("") to represent a single double quote("). eg.
'"Printer ""Name"' or '"Printer """Name"'
=> Using slash and double quote(\") to represent a single double quote(").
eg. '"Printer \"Name"'
Could someone please advice what could be done to support printers with a
double quote in its name.
ShellExcute is used to print to a given printer as follows from VFP9.
DECLARE LONG ShellExecute IN "shell32.dll" LONG nHandle, STRING cOperation,
STRING cFile, ;
STRING vParameters, STRING cDirectory, LONG nShowCmd
lnSuccess = ShellExecute(0, "PRINTTO", "C:\Test.Txt", '"Printer Name"', "",
1)
This works fine.
But the problem is when the name of the printer has a double quote("), it
does not print.
The following does not work.
eg. Assume the name of the printer is '"Printer "Name"' as the parameter
passed into ShellExecute()
=> Using 2 or 3 double quotes("") to represent a single double quote("). eg.
'"Printer ""Name"' or '"Printer """Name"'
=> Using slash and double quote(\") to represent a single double quote(").
eg. '"Printer \"Name"'
Could someone please advice what could be done to support printers with a
double quote in its name.