Hi Diane,
I've created Custom Form for new Contacts entry. Because I need some custom Fields. I need two command buttons. One for upload file path/name in a text box and the other to view the file in its default application. My problem is that only on set of VBScript is working, the one on the top of the Script editor. I need both Click Events to work. I'm spending hours but no way. Please help me get out of this problem.
VBScript below:
Sub CommandButton2_Click()
Set wShell=CreateObject("WScript.Shell")
Set oExec=wShell.Exec("mshta.exe ""about:<input type=file id=FILE><script>FILE.click();new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);close();resizeTo(0,0);</script>""")
sFileSelected = oExec.StdOut.ReadLine
Set FormPage = Item.GetInspector.ModifiedFormPages("General")
Set Control = FormPage.Controls("TextBox1")
Control.Value= sFileSelected
End Sub
Sub CommandButton3_Click()
msgbox "This is command button 3"
End Sub
Thanks in advance for your help.
Momtaz
I've created Custom Form for new Contacts entry. Because I need some custom Fields. I need two command buttons. One for upload file path/name in a text box and the other to view the file in its default application. My problem is that only on set of VBScript is working, the one on the top of the Script editor. I need both Click Events to work. I'm spending hours but no way. Please help me get out of this problem.
VBScript below:
Sub CommandButton2_Click()
Set wShell=CreateObject("WScript.Shell")
Set oExec=wShell.Exec("mshta.exe ""about:<input type=file id=FILE><script>FILE.click();new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);close();resizeTo(0,0);</script>""")
sFileSelected = oExec.StdOut.ReadLine
Set FormPage = Item.GetInspector.ModifiedFormPages("General")
Set Control = FormPage.Controls("TextBox1")
Control.Value= sFileSelected
End Sub
Sub CommandButton3_Click()
msgbox "This is command button 3"
End Sub
Thanks in advance for your help.
Momtaz