The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Passing to external application
Posted: 02 Oct 09 8:49 AM
|
Hi All,
Im using Application.BasicFunctions.DoInvoke "Open", "(location)" to open notepad (as a test). Is there any way i can pass some text to display in the body of the new notepad document that gets opened? |
|
|
|
Re: Passing to external application
Posted: 02 Oct 09 8:24 PM
|
Umm.... Kinda
I don't believe the notepad.exe will accept anything other than a filename..
However, You can write to a file like c:\something.txt
Then open notepad.exe c:\something.txt
Then delete the .txt
Might cause problems if you multiple people hitting this at the same time.
Other Applications like Word, EXCEL, Inet Explorer are OLE Objects so you can easily man handle them thru VB-Script.
|
|
|
|
Re: Passing to external application
Posted: 03 Oct 09 5:17 PM
|
"However, You can write to a file like c:\something.txt
Then open notepad.exe c:\something.txt
Then delete the .txt
Might cause problems if you multiple people hitting this at the same time."
Write the filename as SLX_USERID.txt and you won't have people hitting the same file name at the same time.... |
|
|
|
Re: Passing to external application
Posted: 14 Oct 09 8:30 AM
|
It will be possible if you use the WScript.Shell object for starting notepad:
Option Explicit Dim strMessage strMessage = "Hello World" & vbCrLF & "A new line after a carriage return" Dim wshShell Set wshShell = CreateObject("WScript.Shell") wshShell.Run "notepad.exe" WScript.Sleep 200 wshShell.SendKeys (strMessage) Set wshShell = Nothing
The command "WScript.Sleep 200" is necessary to give "notepad.exe" some time to start and initialize itself before accepting any input. For details have a look at the script56.chm Rescorce of VBScript.
Cheers, Thomas |
|
|
|