Link to home
Start Free TrialLog in
Avatar of bsharath
bsharathFlag for India

asked on

Any way to get the users information to a excel

Hi,

I want a way to send a link,mail or any other way which once the user updates it would update the details to a excel file automatically.

A outlook form which once sent and edited by the user and sent to me has to be updated in a excel.
Or a script with all the boxes which once entered has to update in a excel file.

regards
Sharath
Avatar of RobSampson
RobSampson
Flag of Australia image

HI Sharath, I don't know about Outlook forms (I don't use Outlook), but if you're interested, I think we could make an HTA file (HTA Application)
http://msdn2.microsoft.com/en-us/library/ms536496.aspx

which you email a link to, to your staff, and then when they fill it in, it writes the information to a text file of their name, and you review that file, then import it to excel.

The reason I say it goes to a text file, and not directly to an Excel file, is this: Excel does not share very well, and multiple people writing to it at the same time will be a problem.  Similarly, because you are then the only person initiating the import from text to Excel, there won't be a problem.

So, providing that the HTA won't be too complicated (ie, what sort of info do you need), we can start to build that.

Regards,

Rob.
Avatar of bsharath

ASKER

Thanks a lot Rob for giving me this idea.

I want a form for general information about the user.

Name
Emp Id
Seat No
Designation
Machine Name
Ext No
All are compulsory fieds.

Thanks...
Rob..

I have another Q open with the same help

https://www.experts-exchange.com/questions/22788716/Any-scrip-to-popup-or-push-a-screen-with-all-information-tabs.html

This is also related to the same solution
This one is also related....
https://www.experts-exchange.com/questions/22757477/Any-help-with-a-web-page-creation-which-will-update-the-data-entered-to-a-excel-sheet.html

I suppose the solution posted here (when we get to it) can accomodate all of these questions?

Rob.
Yes Rob....
Rob...The information that i get on the screen... and which i get in the excel is not the full content...Can you even get these left data to the excel....
----------------------------------------------
User Name: Sriram Venkataraman
Account: SriramV
Title: Quality Engineer
Manager: Shantikumar S
Mailbox Server: INEXCHANGE
Description: 07/04/2007
Last logged-on user account: DEVELOPMENT\SriramV
Last logoff time: 20070704050356.000491+***
Last logon time: 20070704033945.000621+***
Server name: INEXCHANGE
Size: 2895
Storage group name: First Storage Group
Store name: Mailbox Store (INEXCHANGE)
Total items: 18
/o=Group/ou=First Administrative Group/cn=Recipients/cn=SriramV
****************************************

These are the details that i get in excel..

Display Name      Login Name      Title      Manager      Mail Server      Description      LegacyExchangeDN
Size,total items all miss in excel sheet
Sorry postd the content here wrongly..

Its for the other Q....
Sharath, let's try this HTA.....paste the text into a file called "User_Information.hta" or something with an HTA extension, and change the line that stores the strTextLogPath value.  This should be on about line 30.  Make sure you modify the one inside the Window_OnLoad procedure, and NOT the empty one that is the global variable declaration.

The strLogFilePath will just be the path only, the file name will be the username + .txt (automatically appended).

'================================
<head>
<title>User Information Form</title>
<HTA:APPLICATION
     APPLICATIONNAME="User Information Form"
     BORDER="thin"
     SCROLL="no"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="normal"
>
</head>

<script language="VBScript">

' Global variable to hold the path to the text files
' they are defined here to be global, but are assigned
' values in the Window_OnLoad procedure
strTextLogPath = ""
strLogFile = ""

Sub Window_OnLoad
      intWidth = 800
      intHeight = 600
      Me.ResizeTo intWidth, intHeight
    Me.MoveTo ((Screen.Width / 2) - (intWidth / 2)),((Screen.Height / 2) - (intHeight / 2))
      Set objNetwork = CreateObject("WScript.Network")
      txt_loginname.Value = objNetwork.UserName
      txt_machinename.Value = objNetwork.ComputerName

      ' This line gets the path from the currently running directory of this HTA
      strTextLogPath = Mid(Replace(Replace(document.URL, "file://", ""), "%20", " "), 1, InStrRev(Replace(Replace(document.URL, "file://", ""), "%20", " "), "\"))
      
      If Right(strTextLogPath, 1) <> "\" Then strTextLogPath = strTextLogPath & "\"
      ' This line appends username.txt to that path
      strLogFile =  strTextLogPath & txt_loginname.Value & ".txt"
      ' This retrieves the user name for the user
      Set objADSysInfo = CreateObject("ADSystemInfo")
      txt_name.Value = Replace(Split(objADSysInfo.UserName, ",")(0), "CN=", "")
      Set objFSO = CreateObject("Scripting.FileSystemObject")
      If objFSO.FileExists(strLogFile) Then
            MsgBox "Your information has already been submitted.  Thank you."
            window.Close
      End If
      Set objFSO = Nothing
End Sub

Sub Default_Buttons
      If Window.Event.KeyCode = 13 Then
            btn_submit.Click
      End If
End Sub

Sub Submit_Form
      If txt_name.Value = "" Then
            MsgBox "Please enter your full name in the Name field."
            txt_name.Focus
      ElseIf txt_empid.Value = "" Then
            MsgBox "Please enter your Employee ID in the Emp ID field."
            txt_empid.Focus
      ElseIf txt_seatno.Value = "" Then
            MsgBox "Please enter your seat number in the Seat No field."
            txt_seatno.Focus
      ElseIf txt_designation.Value = "" Then
            MsgBox "Please enter your designation in the Designation field."
            txt_designation.Focus
      ElseIf txt_extensionno.Value = "" Then
            MsgBox "Please enter your extension number in the Extension No field."
            txt_extensionno.Focus
      Else
            Set objFSO = CreateObject("Scripting.FileSystemObject")
            Set objOutputFile = objFSO.CreateTextFile(strLogFile, True)
            'objOutputFile.Write """Full Name;Login Name;Employee ID;Seat Number;Designation;Machine Name;Extension Number"""
            'objOutputFile.Write VbCrLf & """" & txt_name.Value & ";" & txt_loginname.Value & ";" & txt_empid.Value & ";" & txt_seatno.Value & ";" & txt_designation.Value & ";" & txt_machinename.Value & ";" & txt_extensionno.Value & """"
            objOutputFile.Write "Full Name;Login Name;Employee ID;Seat Number;Designation;Machine Name;Extension Number"
            objOutputFile.Write VbCrLf & txt_name.Value & ";" & txt_loginname.Value & ";" & txt_empid.Value & ";" & txt_seatno.Value & ";" & txt_designation.Value & ";" & txt_machinename.Value & ";" & txt_extensionno.Value
            objOutputFile.Close
            Set objOutputFile = Nothing
            Set objFSO = Nothing
            MsgBox "Thank you for submitting your information."
            window.Close
      End If
End Sub

</script>

<body STYLE="font:14 pt arial; color:white;filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=1, StartColorStr='#000033', EndColorStr='#0000FF')" onkeypress='vbs:Default_Buttons'>
      <table width='90%' height = '100%' align='center' border='0'>
            <tr>
                  <td align='center'>
                        <h3>User Information Form</h3><br>
                  </td>
            </tr
            <tr>
                  <td align='center'>
                        <table>
                              <tr>
                                    <td>
                                          Name:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="30" size="40" id="txt_name" name="txt_name">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Login Name:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="30" size="40" id="txt_loginname" name="txt_loginname" readonly>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Emp ID:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="5" size="10" id="txt_empid" name="txt_emptid">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Seat No:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="5" size="10" id="txt_seatno" name="txt_seatno">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Designation:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="30" size="40" id="txt_designation" name="txt_designation">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Machine Name:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="16" size="25" id="txt_machinname" name="txt_machinename" readonly>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Extension No:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="5" size="10" id="txt_extensionno" name="txt_extensionno">
                                    </td>
                              </tr>
                        </table>
                  </td>
            </tr>
            <tr>
                  <td align='center'>
                        <br>Please note that all fields are required.
                  </td>
            </tr>            
            <tr>
                  <td align='center'>
                        <input type="button" value="Submit" name="btn_submit"  onClick="vbs:Submit_Form"><br><br>
                  </td>
            </tr>
      </table>
</body>
'================================

Regards,

Rob.
Then, after you've done that, and have a couple of different user's text files, use this VBS to combine the text into an XLS file.

In this one, there's two things to change:
strWorkBook = Replace(WScript.ScriptFullName, WScript.ScriptName, "") & "User_Info.xls"
strUserInfoFolder = "."

where strWorkBook is the path to save the XLS file to, and strUserInfoFolder must match the path that the HTA writes the text files to.

'====================
Option Explicit
' Combine_User_Info_To_Excel.vbs
Dim strWorkBook, strUserInfoFolder, objFSO, objExcelApp, objFile, objOpenFile, arrSingleLine, intCount, intRow

Const intForReading = 1
Const xlCalculationManual = -4135
Const xlCalculationAutomatic = -4105

' Change the line below to the path where you would like the Excel spreadsheet to be saved.
strWorkBook = Replace(WScript.ScriptFullName, WScript.ScriptName, "") & "User_Info.xls"
' Change the line below to the full UNC path to the share that the text files are written to.
strUserInfoFolder = "."

Set objFSO = CreateObject("Scripting.FileSystemObject")

' Create Excel Spreadsheet
Set objExcelApp = CreateObject("Excel.Application")
objExcelApp.Visible = False
objExcelApp.Workbooks.Add
objExcelApp.ScreenUpdating = False
objExcelApp.Calculation = xlCalculationManual
While objExcelApp.Sheets.Count > 1
      objExcelApp.Sheets(objExcelApp.Sheets.Count).Delete
Wend

objExcelApp.ActiveWorkbook.Sheets(1).Activate
objExcelApp.ActiveSheet.Rows(1).Font.Bold = True

intRow = 1

For Each objFile In objFSO.GetFolder(strUserInfoFolder).Files
      'Reset back to column A for each file
      If LCase(Right(objFile.Name, 4)) = ".txt" Then
            Set objOpenFile = objFSO.OpenTextFile(objFile.Name, intForReading, False)
            While Not objOpenFile.AtEndOfStream
                  arrSingleLine = Split(objOpenFile.ReadLine, ";")
                  If objExcelApp.ActiveSheet.Range("A1").FormulaR1C1 <> arrSingleLine(0) Then
                        For intCount = LBound(arrSingleLine) To UBound(arrSingleLine)
                              objExcelApp.ActiveSheet.Cells(intRow, intCount + 1).FormulaR1C1 = arrSingleLine(intCount)
                        Next
                        intRow = intRow + 1
                  End If
            Wend
      End If
Next

'Autofit all columns
objExcelApp.ActiveSheet.Columns.EntireColumn.AutoFit

' Save Excel File
objExcelApp.DisplayAlerts = False
objExcelApp.ActiveWorkbook.SaveAs strWorkBook
objExcelApp.DisplayAlerts = True
objExcelApp.ScreenUpdating = True
objExcelApp.Calculation = xlCalculationAutomatic
objExcelApp.ActiveWorkbook.Close False
objExcelApp.Quit

MsgBox "Done"
'====================

Regards,

Rob.
Rob on the 30th and 31st line i have this.

' This line gets the path from the currently running directory of this HTA
      strTextLogPath = Mid(Replace(Replace(document.URL, "file://", ""), "%20", " "), 1, InStrRev(Replace(Replace(document.URL, "file://", ""), "%20", " "), "\"))

What is the data i need to change
You can leave that line as it is, if you want the files to be stored in the same folder as the HTA itself (although then it should be in a network shared folder), or you can change it to any UNC path, such as:
strTextLogPath = "\\server\sharedfolder"

Regards,

Rob.
Great colour Rob.
How should i send this to all users?
Can we push this file to all desktops in the file.Where i have the machine names in the file.
Or if i send it through mail will it get the details remotely?
Should it be like this?
strTextLogPath = "\\server\sharedfolder"Mid(Replace(Replace(document.URL, "file://", ""), "%20", " "), 1, InStrRev(Replace(Replace(document.URL, "file://", ""), "%20", " "), "\"))
Provided that the user has access to the HTA on a network share, you can email them a UNC path link to that HTA, and they should be able to open it, and fill it in.  I think that would be the best way, so you don't have to worry about copying it to computers, then removing it again.

Please test that with a couple of users first, then test the combining VBS script as well.

As I said, as long as you have the HTA in a network share, and the LogFilePath points to a network share they can access, it should work fine.

Regards,

Rob.
No, just
strTextLogPath = "\\server\sharedfolder"

is fine.  The whole
Mid(Replace(Replace(document.URL, "file://", ""), "%20", " "), 1, InStrRev(Replace(Replace(document.URL, "file://", ""), "%20", " "), "\"))

bit only gets the current path of the HTA, which is not required if you don't want the files there....

Regards,

Rob.
Small additions Rob.

1. A drop down boxes with 2 locations as "Chennai" and "Hyderabad"
2. Below in the right corner a notes box.Showing this data " This information is required to keep your details upto date in our database"
3. Ext and emp id should not accept more than 4 no's and should not accept Alphabits.
4. Designation should not accept numbers..

Rob for the combining script i get this..

---------------------------
Windows Script Host
---------------------------
Script:      C:\Documents and Settings\sharathr\Desktop\Combinetxtfile.vbs
Line:      38
Char:      19
Error:      Subscript out of range: '[number: 0]'
Code:      800A0009
Source:       Microsoft VBScript runtime error

---------------------------
OK  
---------------------------
I have 2 txt files generated
In the HTA file 1 last addition
Building and should have a scroll down menu as" Shafika""Hafiz Court" GR Plaza" "Hafiz Fort" and "Titus Towers"
Do you have any empty lines in the Computers.txt file?
Also, now that it crashed, please go to Task Manager and kill Excel.exe
To see what's happening, change
objExcelApp.Visible = False
to
objExcelApp.Visible = True

Try this:
'=================
Option Explicit
' Combine_User_Info_To_Excel.vbs
Dim strWorkBook, strUserInfoFolder, objFSO, objExcelApp, objFile, objOpenFile, arrSingleLine, intCount, intRow

Const intForReading = 1
Const xlCalculationManual = -4135
Const xlCalculationAutomatic = -4105

' Change the line below to the path where you would like the Excel spreadsheet to be saved.
strWorkBook = Replace(WScript.ScriptFullName, WScript.ScriptName, "") & "User_Info.xls"
' Change the line below to the full UNC path to the share that the text files are written to.
strUserInfoFolder = "."

Set objFSO = CreateObject("Scripting.FileSystemObject")

' Create Excel Spreadsheet
Set objExcelApp = CreateObject("Excel.Application")
objExcelApp.Visible = False
objExcelApp.Workbooks.Add
objExcelApp.ScreenUpdating = False
objExcelApp.Calculation = xlCalculationManual
While objExcelApp.Sheets.Count > 1
      objExcelApp.Sheets(objExcelApp.Sheets.Count).Delete
Wend

objExcelApp.ActiveWorkbook.Sheets(1).Activate
objExcelApp.ActiveSheet.Rows(1).Font.Bold = True

intRow = 1

For Each objFile In objFSO.GetFolder(strUserInfoFolder).Files
      'Reset back to column A for each file
      If LCase(Right(objFile.Name, 4)) = ".txt" Then
            Set objOpenFile = objFSO.OpenTextFile(objFile.Name, intForReading, False)
            While Not objOpenFile.AtEndOfStream
                  strLine = objOpenFile.ReadLine
                  If Len(strLine) > 0 Then
                        arrSingleLine = Split(objOpenFile.ReadLine, ";")
                        If objExcelApp.ActiveSheet.Range("A1").FormulaR1C1 <> arrSingleLine(0) Then
                              For intCount = LBound(arrSingleLine) To UBound(arrSingleLine)
                                    objExcelApp.ActiveSheet.Cells(intRow, intCount + 1).FormulaR1C1 = arrSingleLine(intCount)
                              Next
                              intRow = intRow + 1
                        End If
                  End If
            Wend
      End If
Next

'Autofit all columns
objExcelApp.ActiveSheet.Columns.EntireColumn.AutoFit

' Save Excel File
objExcelApp.DisplayAlerts = False
objExcelApp.ActiveWorkbook.SaveAs strWorkBook
objExcelApp.DisplayAlerts = True
objExcelApp.ScreenUpdating = True
objExcelApp.Calculation = xlCalculationAutomatic
objExcelApp.ActiveWorkbook.Close False
objExcelApp.Quit

MsgBox "Done"
'=================

Regards,

Rob.
Rob i get this.

---------------------------
Windows Script Host
---------------------------
Script:      C:\Documents and Settings\sharathr\Desktop\Combinetxtfile.vbs
Line:      37
Char:      19
Error:      Variable is undefined: 'strLine'
Code:      800A01F4
Source:       Microsoft VBScript runtime error

---------------------------
OK  
---------------------------

It opens a excel sheet and then gives the above error.
Should i change any thing in the script.I fjust changed the false to True and still got the same error.
Sorry, please also add
, strLine
to the end of the Dim line at the top of the XLS writing VBS file.

Regards,

Rob.
Oh, another bit I forgot, this should work for the VBS:
'=================
Option Explicit
' Combine_User_Info_To_Excel.vbs
Dim strWorkBook, strUserInfoFolder, objFSO, objExcelApp, objFile, objOpenFile, arrSingleLine, intCount, intRow, strLine

Const intForReading = 1
Const xlCalculationManual = -4135
Const xlCalculationAutomatic = -4105

' Change the line below to the path where you would like the Excel spreadsheet to be saved.
strWorkBook = Replace(WScript.ScriptFullName, WScript.ScriptName, "") & "User_Info.xls"
' Change the line below to the full UNC path to the share that the text files are written to.
strUserInfoFolder = "."

Set objFSO = CreateObject("Scripting.FileSystemObject")

' Create Excel Spreadsheet
Set objExcelApp = CreateObject("Excel.Application")
objExcelApp.Visible = False
objExcelApp.Workbooks.Add
objExcelApp.ScreenUpdating = False
objExcelApp.Calculation = xlCalculationManual
While objExcelApp.Sheets.Count > 1
      objExcelApp.Sheets(objExcelApp.Sheets.Count).Delete
Wend

objExcelApp.ActiveWorkbook.Sheets(1).Activate
objExcelApp.ActiveSheet.Rows(1).Font.Bold = True

intRow = 1

For Each objFile In objFSO.GetFolder(strUserInfoFolder).Files
      'Reset back to column A for each file
      If LCase(Right(objFile.Name, 4)) = ".txt" Then
            Set objOpenFile = objFSO.OpenTextFile(objFile.Name, intForReading, False)
            While Not objOpenFile.AtEndOfStream
                  strLine = objOpenFile.ReadLine
                  If Len(strLine) > 0 Then
                        arrSingleLine = Split(strLine, ";")
                        If objExcelApp.ActiveSheet.Range("A1").FormulaR1C1 <> arrSingleLine(0) Then
                              For intCount = LBound(arrSingleLine) To UBound(arrSingleLine)
                                    objExcelApp.ActiveSheet.Cells(intRow, intCount + 1).FormulaR1C1 = arrSingleLine(intCount)
                              Next
                              intRow = intRow + 1
                        End If
                  End If
            Wend
      End If
Next

'Autofit all columns
objExcelApp.ActiveSheet.Columns.EntireColumn.AutoFit

' Save Excel File
objExcelApp.DisplayAlerts = False
objExcelApp.ActiveWorkbook.SaveAs strWorkBook
objExcelApp.DisplayAlerts = True
objExcelApp.ScreenUpdating = True
objExcelApp.Calculation = xlCalculationAutomatic
objExcelApp.ActiveWorkbook.Close False
objExcelApp.Quit

MsgBox "Done"
'================

Regards,

Rob.
Sorry Rob i am not able to understand where.

Is it here

Option Explicit
' Combine_User_Info_To_Excel.vbs
Dim strWorkBook, strUserInfoFolder, objFSO, objExcelApp, objFile, objOpenFile, arrSingleLine, intCount, intRow
Never mind the strLine thing, it should be fixed in the latest code I posted....
Yes Rob this worked..Thanks...
Can you make the changes for the Hta file...
Try this:
'=============
<head>
<title>User Information Form</title>
<HTA:APPLICATION
     APPLICATIONNAME="User Information Form"
     BORDER="thin"
     SCROLL="no"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="normal"
>
</head>

<script language="VBScript">

' Global variable to hold the path to the text files
' they are defined here to be global, but are assigned
' values in the Window_OnLoad procedure
strTextLogPath = ""
strLogFile = ""

Sub Window_OnLoad
      intWidth = 800
      intHeight = 600
      Me.ResizeTo intWidth, intHeight
    Me.MoveTo ((Screen.Width / 2) - (intWidth / 2)),((Screen.Height / 2) - (intHeight / 2))
    cbo_building.Style.Width = 150
      Set objNetwork = CreateObject("WScript.Network")
      txt_loginname.Value = objNetwork.UserName
      txt_machinename.Value = objNetwork.ComputerName

      ' This line gets the path from the currently running directory of this HTA
      strTextLogPath = Mid(Replace(Replace(document.URL, "file://", ""), "%20", " "), 1, InStrRev(Replace(Replace(document.URL, "file://", ""), "%20", " "), "\"))
      
      If Right(strTextLogPath, 1) <> "\" Then strTextLogPath = strTextLogPath & "\"
      ' This line appends username.txt to that path
      strLogFile =  strTextLogPath & txt_loginname.Value & ".txt"
      ' This retrieves the user name for the user
      Set objADSysInfo = CreateObject("ADSystemInfo")
      txt_name.Value = Replace(Split(objADSysInfo.UserName, ",")(0), "CN=", "")
      Set objFSO = CreateObject("Scripting.FileSystemObject")
      If objFSO.FileExists(strLogFile) Then
            MsgBox "Your information has already been submitted.  Thank you."
            window.Close
      End If
      Set objFSO = Nothing
End Sub

Sub Default_Buttons
      If Window.Event.KeyCode = 13 Then
            btn_submit.Click
      End If
End Sub

Sub Submit_Form
      If txt_name.Value = "" Then
            MsgBox "Please enter your full name in the Name field."
            txt_name.Focus
      ElseIf txt_empid.Value = "" Then
            MsgBox "Please enter your Employee ID in the Emp ID field."
            txt_empid.Focus
      ElseIf txt_seatno.Value = "" Then
            MsgBox "Please enter your seat number in the Seat No field."
            txt_seatno.Focus
      ElseIf txt_designation.Value = "" Then
            MsgBox "Please enter your designation in the Designation field."
            txt_designation.Focus
      ElseIf cbo_building.Value = "opt_none" Then
            MsgBox "Please select your building from the Building drop down box."
            cbo_building.Focus
      ElseIf txt_extensionno.Value = "" Then
            MsgBox "Please enter your extension number in the Extension No field."
            txt_extensionno.Focus
      Else
            Set objFSO = CreateObject("Scripting.FileSystemObject")
            Set objOutputFile = objFSO.CreateTextFile(strLogFile, True)
            'objOutputFile.Write """Full Name;Login Name;Employee ID;Seat Number;Designation;Machine Name;Extension Number"""
            'objOutputFile.Write VbCrLf & """" & txt_name.Value & ";" & txt_loginname.Value & ";" & txt_empid.Value & ";" & txt_seatno.Value & ";" & txt_designation.Value & ";" & txt_machinename.Value & ";" & txt_extensionno.Value & """"
            objOutputFile.Write "Full Name;Login Name;Employee ID;Seat Number;Designation;Building;Machine Name;Extension Number"
            objOutputFile.Write VbCrLf & txt_name.Value & ";" & txt_loginname.Value & ";" & txt_empid.Value & ";" & txt_seatno.Value & ";" & txt_designation.Value & ";" & cbo_Building.Value & ";" & txt_machinename.Value & ";" & txt_extensionno.Value
            objOutputFile.Close
            Set objOutputFile = Nothing
            Set objFSO = Nothing
            MsgBox "Thank you for submitting your information."
            window.Close
      End If
End Sub

</script>

<body STYLE="font:14 pt arial; color:white;filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=1, StartColorStr='#000033', EndColorStr='#0000FF')" onkeypress='vbs:Default_Buttons'>
      <table width='90%' height = '100%' align='center' border='0'>
            <tr>
                  <td align='center'>
                        <h3>User Information Form</h3><br>
                  </td>
            </tr
            <tr>
                  <td align='center'>
                        <table>
                              <tr>
                                    <td>
                                          Name:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="30" size="40" id="txt_name" name="txt_name">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Login Name:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="30" size="40" id="txt_loginname" name="txt_loginname" readonly>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Emp ID:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="5" size="10" id="txt_empid" name="txt_emptid">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Seat No:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="5" size="10" id="txt_seatno" name="txt_seatno">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Designation:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="30" size="40" id="txt_designation" name="txt_designation">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Building:
                                    </td>
                                    <td>
                                          <select size="1" id="cbo_building" name="cbo_building">
                                                <option id="opt_none" value="opt_none" selected> --- Select Building --- </option>
                                                <option id="opt_shafika" value="Shafika">Shafika</option>
                                                <option id="opt_hafizcourt" value="Hafiz Court">Hafiz Court</option>
                                                <option id="opt_grplaza" value="GR Plaza">GR Plaza</option>
                                                <option id="opt_hafizfort" value="Hafiz Fort">Hafiz Fort</option>
                                                <option id="opt_titustowers" value="Titus Towers">Titus Towers</option>
                                          </select>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Machine Name:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="16" size="25" id="txt_machinname" name="txt_machinename" readonly>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Extension No:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="5" size="10" id="txt_extensionno" name="txt_extensionno">
                                    </td>
                              </tr>
                        </table>
                  </td>
            </tr>
            <tr>
                  <td align='center'>
                        <br>Please note that all fields are required.
                  </td>
            </tr>            
            <tr>
                  <td align='center'>
                        <input type="button" value="Submit" name="btn_submit"  onClick="vbs:Submit_Form"><br><br>
                  </td>
            </tr>
      </table>
</body>
'=============

Regards,

Rob.

1. A drop down boxes with 2 locations as "Chennai" and "Hyderabad"
2. Below in the right corner a notes box.Showing this data " This information is required to keep your details upto date in our database"
3. Designation should not accept numbers..
4.The Hta file still accepts Alphabits in Ext No Can you min it to 4 from 5
Rob can you put the Building above the Seat No.
Please increase the characters in Seat No to 10 as it does not accept more that 5 characters

Sorry final changes...
Rob by keeping this in  ashared folder and sending everyone a mail to update this seems as not secure.As every one who opens the shared folder can see others data.
Can we make the Hta file not to open the code or be copied by others....
If i even change the file path to some other path the Hta file is open so others can open the code and see the location..

As all are software engineers with whome i need to deal with....

OK, here's the changes on the HTA:
'================
<head>
<title>User Information Form</title>
<HTA:APPLICATION
     APPLICATIONNAME="User Information Form"
     BORDER="thin"
     SCROLL="no"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="normal"
>
</head>

<script language="VBScript">

' Global variable to hold the path to the text files
' they are defined here to be global, but are assigned
' values in the Window_OnLoad procedure
strTextLogPath = ""
strLogFile = ""

Sub Window_OnLoad
      intWidth = 800
      intHeight = 600
      Me.ResizeTo intWidth, intHeight
    Me.MoveTo ((Screen.Width / 2) - (intWidth / 2)),((Screen.Height / 2) - (intHeight / 2))
    cbo_building.Style.Width = 150
      Set objNetwork = CreateObject("WScript.Network")
      txt_loginname.Value = objNetwork.UserName
      txt_machinename.Value = objNetwork.ComputerName

      ' This line gets the path from the currently running directory of this HTA
      strTextLogPath = Mid(Replace(Replace(document.URL, "file://", ""), "%20", " "), 1, InStrRev(Replace(Replace(document.URL, "file://", ""), "%20", " "), "\"))
      
      If Right(strTextLogPath, 1) <> "\" Then strTextLogPath = strTextLogPath & "\"
      ' This line appends username.txt to that path
      strLogFile =  strTextLogPath & txt_loginname.Value & ".txt"
      ' This retrieves the user name for the user
      Set objADSysInfo = CreateObject("ADSystemInfo")
      txt_name.Value = Replace(Split(objADSysInfo.UserName, ",")(0), "CN=", "")
      Set objFSO = CreateObject("Scripting.FileSystemObject")
      If objFSO.FileExists(strLogFile) Then
            MsgBox "Your information has already been submitted.  Thank you."
            window.Close
      End If
      Set objFSO = Nothing
End Sub

Sub Default_Buttons
      If Window.Event.KeyCode = 13 Then
            btn_submit.Click
      End If
End Sub

Sub Submit_Form
      If txt_name.Value = "" Then
            MsgBox "Please enter your full name in the Name field."
            txt_name.Focus
      ElseIf txt_empid.Value = "" Then
            MsgBox "Please enter your Employee ID in the Emp ID field."
            txt_empid.Focus
      ElseIf cbo_building.Value = "opt_none" Then
            MsgBox "Please select your building from the Building drop down box."
            cbo_building.Focus
      ElseIf txt_seatno.Value = "" Then
            MsgBox "Please enter your seat number in the Seat No field."
            txt_seatno.Focus
      ElseIf txt_designation.Value = "" Then
            MsgBox "Please enter your designation in the Designation field."
            txt_designation.Focus
      ElseIf cbo_location.Value = "opt_none" Then
            MsgBox "Please select your location from the Location drop down box."
            cbo_location.Focus
      ElseIf txt_extensionno.Value = "" Then
            MsgBox "Please enter your extension number in the Extension No field."
            txt_extensionno.Focus
      Else
            Set objFSO = CreateObject("Scripting.FileSystemObject")
            Set objOutputFile = objFSO.CreateTextFile(strLogFile, True)
            'objOutputFile.Write """Full Name;Login Name;Employee ID;Seat Number;Designation;Machine Name;Extension Number"""
            'objOutputFile.Write VbCrLf & """" & txt_name.Value & ";" & txt_loginname.Value & ";" & txt_empid.Value & ";" & txt_seatno.Value & ";" & txt_designation.Value & ";" & txt_machinename.Value & ";" & txt_extensionno.Value & """"
            objOutputFile.Write "Full Name;Login Name;Employee ID;Building;Seat Number;Designation;Location;Machine Name;Extension Number"
            objOutputFile.Write VbCrLf & txt_name.Value & ";" & txt_loginname.Value & ";" & txt_empid.Value & ";" & cbo_Building.Value & ";" & txt_seatno.Value & ";" & txt_designation.Value & ";" & cbo_Location.Value & ";" & txt_machinename.Value & ";" & txt_extensionno.Value
            objOutputFile.Close
            Set objOutputFile = Nothing
            Set objFSO = Nothing
            MsgBox "Thank you for submitting your information."
            window.Close
      End If
End Sub

Sub Validate_Keys(strField)
      If LCase(strField) = "designation" Then
            If Window.Event.KeyCode >= 48 And Window.Event.KeyCode <= 57 Then Window.Event.KeyCode = Null
      ElseIf LCase(strField) = "extensionno" Then
            If Window.Event.KeyCode < 48 Or Window.Event.KeyCode > 57 Then Window.Event.KeyCode = Null
      End If
End Sub

</script>

<body STYLE="font:14 pt arial; color:white;filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=1, StartColorStr='#000033', EndColorStr='#0000FF')" onkeypress='vbs:Default_Buttons'>
      <table width='90%' height = '100%' align='center' border='0'>
            <tr>
                  <td align='center'>
                        <h3>User Information Form</h3><br>
                  </td>
            </tr
            <tr>
                  <td align='center'>
                        <table>
                              <tr>
                                    <td>
                                          Name:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="30" size="40" id="txt_name" name="txt_name">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Login Name:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="30" size="40" id="txt_loginname" name="txt_loginname" readonly>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Emp ID:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="5" size="10" id="txt_empid" name="txt_emptid">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Building:
                                    </td>
                                    <td>
                                          <select size="1" id="cbo_building" name="cbo_building">
                                                <option id="opt_none" value="opt_none" selected> --- Select Building --- </option>
                                                <option id="opt_shafika" value="Shafika">Shafika</option>
                                                <option id="opt_hafizcourt" value="Hafiz Court">Hafiz Court</option>
                                                <option id="opt_grplaza" value="GR Plaza">GR Plaza</option>
                                                <option id="opt_hafizfort" value="Hafiz Fort">Hafiz Fort</option>
                                                <option id="opt_titustowers" value="Titus Towers">Titus Towers</option>
                                          </select>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Seat No:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="10" size="15" id="txt_seatno" name="txt_seatno">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Designation:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="30" size="40" id="txt_designation" name="txt_designation" onkeypress="vbs:Validate_Keys('designation')">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Location:
                                    </td>
                                    <td>
                                          <select size="1" id="cbo_location" name="cbo_location">
                                                <option id="opt_none" value="opt_none" selected> --- Select Location --- </option>
                                                <option id="opt_chennai" value="Chennai">Chennai</option>
                                                <option id="opt_hyderabad" value="Hyderabad">Hyderabad</option>
                                          </select>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Machine Name:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="16" size="25" id="txt_machinname" name="txt_machinename" readonly>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Extension No:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="4" size="10" id="txt_extensionno" name="txt_extensionno" onkeypress="vbs:Validate_Keys('extensionno')">
                                    </td>
                              </tr>
                        </table>
                  </td>
            </tr>
            <tr>
                  <td align='center'>
                        <br>Please note that all fields are required.
                  </td>
            </tr>            
            <tr>
                  <td align='center'>
                        <input type="button" value="Submit" name="btn_submit"  onClick="vbs:Submit_Form"><br><br>
                  </td>
            </tr>
            <tr>
                  <td align="right">
                        This information is required to keep<br>
                        your details up to date in our database
                  </td>
            </tr>
      </table>
</body>
'================

Now, as far as security goes.....check this article out:
http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar06/hey0309.mspx

It tells you how to "encode" the VBScript elements inside the HTA, which will scramble the script inside it, and should not be viewable via any editor.

Regards,

Rob.
And then, as I think you have done, change the text file location to somewhere they are not aware of.

Rob.
Rob should i change this part to change the location of the outputs

' Global variable to hold the path to the text files
' they are defined here to be global, but are assigned
' values in the Window_OnLoad procedure
strTextLogPath = "\\servername\foldername"
strLogFile = "" (Should i change this also.)
No, sorry, just the strTextLogPath that is inside the Window_OnLoad procedure, as you did before, on about line 30 or 31.

The two at the top that are global variables should remain empty.

Regards,

Rob.
Ok thanks Rob got it.

Last help the encoding of the script can you put it in short here please...
     
OK, download the Microsoft Script Encoder and install it from here:
http://www.microsoft.com/downloads/details.aspx?FamilyId=E7877F67-C447-4873-B1B0-21F0626A6329

Then put this line:
'**Start Encode**

underneath this line
<script language="VBScript">

so it looks like this:
<script language="VBScript">
'**Start Encode**


Then, rename the HTA extension to HTM, and run this command:
C:\Program Files\Windows Script Encoder>screnc <filename>.htm <filename>.hta

where <filename> is replaced with the full path your file.

Then, the HTA that gets created should be encoded.

Please bear in mind though, this is not entirely secure (from that MS website):
"the important thing to keep in mind is that the script is simply encoded (or obfuscated); it is definitely not encrypted. What does that mean? That means the encoder will hide your script from most people; however, a truly determined hacker - armed with a knowledge of codes or armed with a utility downloaded from the Internet - could crack the code. Among other things, that means that you should never do something like hide an Administrator password in a script and assume that the Script Encoder will keep it safe from prying eyes. It wont. Its an encoder, not an encrypter, and theres definitely a difference"

Regards,

Rob.
Rob any way to fetch Email id automatically
Rob you have great Patients....:)
Email ID?  As in their email address from Exchange>
Rob the code looks like this.


<head>
<title>User Information Form</title>
<HTA:APPLICATION
     APPLICATIONNAME="User Information Form"
     BORDER="thin"
     SCROLL="no"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="normal"
>
</head>

<script language="VBScript.Encode">#@~^yhAAAA==@#@&@#@&EPVVW(l^~\mDrl(Vn~DWP4GV9PY4n~wmY4POW~O4+~YaY,0rs/@#@&v,Y4+H~mDn,N0k      +9~tDnPDW~8Po^G4mV~,8;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EAA==^#~@</script>

<body STYLE="font:14 pt arial; color:white;filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=1, StartColorStr='#000033', EndColorStr='#0000FF')" onkeypress='vbs:Default_Buttons'>
      <table width='90%' height = '100%' align='center' border='0'>
            <tr>
                  <td align='center'>
                        <h3>User Information Form</h3><br>
                  </td>
            </tr
            <tr>
                  <td align='center'>
                        <table>
                              <tr>
                                    <td>
                                          Name:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="30" size="40" id="txt_name" name="txt_name">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Login Name:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="30" size="40" id="txt_loginname" name="txt_loginname" readonly>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Emp ID:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="5" size="10" id="txt_empid" name="txt_emptid">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Building:
                                    </td>
                                    <td>
                                          <select size="1" id="cbo_building" name="cbo_building">
                                                <option id="opt_none" value="opt_none" selected> --- Select Building --- </option>
                                                <option id="opt_shafika" value="Shafika">Shafika</option>
                                                <option id="opt_hafizcourt" value="Hafiz Court">Hafiz Court</option>
                                                <option id="opt_grplaza" value="GR Plaza">GR Plaza</option>
                                                <option id="opt_hafizfort" value="Hafiz Fort">Hafiz Fort</option>
                                                <option id="opt_titustowers" value="Titus Towers">Titus Towers</option>
                                          </select>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Seat No:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="10" size="15" id="txt_seatno" name="txt_seatno">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Designation:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="30" size="40" id="txt_designation" name="txt_designation" onkeypress="vbs:Validate_Keys('designation')">
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Location:
                                    </td>
                                    <td>
                                          <select size="1" id="cbo_location" name="cbo_location">
                                                <option id="opt_none" value="opt_none" selected> --- Select Location --- </option>
                                                <option id="opt_chennai" value="Chennai">Chennai</option>
                                                <option id="opt_hyderabad" value="Hyderabad">Hyderabad</option>
                                          </select>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Machine Name:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="16" size="25" id="txt_machinname" name="txt_machinename" readonly>
                                    </td>
                              </tr>
                              <tr>
                                    <td>
                                          Extension No:
                                    </td>
                                    <td>
                                          <input type="text" maxlength="4" size="10" id="txt_extensionno" name="txt_extensionno" onkeypress="vbs:Validate_Keys('extensionno')">
                                    </td>
                              </tr>
                        </table>
                  </td>
            </tr>
            <tr>
                  <td align='center'>
                        <br>Please note that all fields are required.
                  </td>
            </tr>            
            <tr>
                  <td align='center'>
                        <input type="button" value="Submit" name="btn_submit"  onClick="vbs:Submit_Form"><br><br>
                  </td>
            </tr>
            <tr>
                  <td align="right">
                        This information is required to keep<br>
                        your details up to date in our database
                  </td>
            </tr>
      </table>
</body>


Is this correct...
Will it not fully encode...
As you got the username and Nt login the same way can we get the Email id....
Or else can you put in a box to enter the email id
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks a lot Rob can you put in the answers in the other 2 posts please.I can close them too.
Rob i have raised a new Q for some more additions.

https://www.experts-exchange.com/questions/22796517/Need-a-little-addition-in-this-HTA-code.html

Just want to give you more and more points for the excellent job...:)