on 01-24-2013 9:45 AM
Hi Guys,
I wonder if there is any way to use a vbscript for save as window.
For example I created a script for generating a report automatically and everything goes fine till the save as window.
It seems that this window is not object in SAP and I don’t know how to modify the script in order to save the report.
Please let me know if you have any idea.
Regards,
Guerolito
Hi Guerolito,
yes youre right - the save as window is from Windows and cant be accessed "directly" from your Basic Script ....
but there is a Way to do:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I’m sorry but I’m not fully aware how to implement the example you provided.
As far as understand this script initiates another previously created with this:
Path = inputbox("Please enter a filename: ","filename","c:\tmp\test.htm")
set Wshell = CreateObject("WScript.Shell")
wshell.run """c:\tmp\save_as.vbs """ & Path
And the previously created script is:
if Wscript.Arguments.count > 0 then
set fs = CreateObject("Scripting.FileSystemObject")
if fs.fileExists(WScript.arguments(0)) then
Set myfile = fs.GetFile(WScript.arguments(0))
myfile.Delete
end if
set Wshell = CreateObject("WScript.Shell")
Do
bWindowFound = Wshell.AppActivate("Save As")
WScript.Sleep 1000
Loop Until bWindowFound
Do
Wshell.appActivate "Save As"
Wshell.sendkeys WScript.arguments(0)
WScript.Sleep 400
Wshell.appActivate "Save As"
Wshell.sendkeys "%s"
WScript.Sleep 400
bWindowFound = Wshell.AppActivate("Save As")
WScript.Sleep 400
Loop Until not bWindowFound
end if
Can you give some additional information on the script?
I don’t know much for WSH object model and currently reading for it.
One more question- Is it possible this code to be used when pdf files are generated for example POs?
Thank you and regards
Guerolito
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.