Hello sir, I'd like to know if I can print a file automatically after Ascendis registers a new call and if that's possible how can I do it?
Thanks a lot,
Enrique
Automatic file print script...??
Re: Automatic file print script...??
Hello Enrique,
What kind of file would you like to print?
If the program that created the file has a command line print option, like Windows Notepad, you can do it with an advanced script such as this:
Note that the above script uses the "Log" command to put something into the file. If you have an existing file, you don't need this.
Finest regards,
Bill Root
Ascendis Software
What kind of file would you like to print?
If the program that created the file has a command line print option, like Windows Notepad, you can do it with an advanced script such as this:
Code: Select all
// LANGUAGE=DWS
Log('temp.txt', 'ABCDEFG');
Run('notepad.exe', '/p temp.txt');
Finest regards,
Bill Root
Ascendis Software
Excel file automatically print
Well, I'd like to print a file from Excel but I think that this program doesn't recognize the /p command...
Is there any other command or script that I can use?
Thanks agian.
Enrique
Is there any other command or script that I can use?
Thanks agian.
Enrique
Re: Excel file automatically print
I couldn't find a command-line option for Excel, either. But, I did find the following:
Put the above code into a file named 'PrintXls.vbs'. Save it somewhere convenient.
Now, use this script from Ascendis Caller ID to print:
That worked in my tests. It requires Windows Script Host, which is installed by default on recent versions of Windows, I think. See the URL in the first script for more information.
Finest regards,
Bill Root
Ascendis Software
Code: Select all
' from http://groups.google.com/group/microsoft.public.excel.misc/msg/88267cfecdb4fd9c?dmode=source
' Author: Steve Yandl
'
' Print an Excel XLS file
Const xlDoNotSaveChanges = 2
Dim fso, oXL, oWkbk
Set fso = CreateObject("Scripting.FileSystemObject")
Set oXL = CreateObject("Excel.Application")
oXL.Visible = False
If WScript.Arguments.Count = 0 Then
WScript.Quit
Else
For A = 0 To (WScript.Arguments.Count - 1)
If (Right(WScript.Arguments.Item(A), 3) = "xls") _
AND fso.FileExists(WScript.Arguments.Item(A)) Then
Set oWkbk = oXL.Workbooks.Open(WScript.Arguments.Item(A))
oWkbk.PrintOut
oWkbk.Close xlDoNotSaveChanges
End If
Next
End If
oXL.Quit
Set fso = Nothing
Set oXL = Nothing
Now, use this script from Ascendis Caller ID to print:
Code: Select all
// LANGUAGE=DWS
// print from Excel:
// replace "c:\transfer\" with the location of PrintXLS.vbs
// replace "c:\transfer\temp.xls" with the name of the Excel file to print
Run('c:\transfer\PrintXLS.vbs', 'c:\transfer\temp.xls');
Finest regards,
Bill Root
Ascendis Software
Re: THANKS!!!
You are most welcome!
-Bill
-Bill