Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Programming (http://www.go4expert.com/forums/programming-forum/)
-   -   need help with VB script xls to txt (http://www.go4expert.com/forums/help-vb-script-xls-txt-t20272/)

rstruble 4Dec2009 01:20

need help with VB script xls to txt
 
Hello,

I am trying to creat a script in VB that will take data from specific columns in an Excel sheet and populate it into a text document that i can then send as a reply in Outlook. I have the script that will creat the basic "spine" of the text document but i can not figure out how to pull the data from the Excel sheet.

here is what i have:

Code: VB

Set objFSO = CreateObject("Scripting.FileSystemObject")   
Set objNewFile = objFSO.CreateTextFile("C:\test2.txt")
    objNewFile.Close
strLogFile = "C:\test2.txt"
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strLogFile, 8)
        objFile.WriteLine "Dear <NAME>"
        objFile.WriteLine "  "
        objFile.WriteLine "This email is in response to your feedback message:"
        objFile.WriteLine "  "
        objFile.WriteLine "Feedback Message ID:        <___>"
        objFile.WriteLine "  "
        objFile.WriteLine "Submission Date:        <Date>"
        objFile.WriteLine "  "
        objFile.WriteLine "RE:        <Description>"
        objFile.WriteLine "  "
        objFile.WriteLine "We appreciate your feedback. We are researching your request and looking into possible solutions for your suggestions."
        objFile.WriteLine "   "
        objFile.WriteLine "Thank you,"
        objFile.WriteLine "  "
        objFile.WriteLine "NAME"
        objFile.WriteLine "Title"

        WScript.Quit
objFile.Close

WScript.Quit(0)


i would like to fill the <> with specific data from the excel sheet and i would also like to have the script create the text file with the name of the person i will be replying to, also in the excel sheet. any help would be greatly appreciated.

Thank you
RStruble


All times are GMT +5.5. The time now is 22:55.