| |
bob640
Posts: 1
Score: 0
Joined: 7/7/2007
Status: offline
|
Hi Guys, im a newbie to VBScript and I only need it to perform two simple tasks in a custom outlook for that i'm building. I have been trying to look up what I need to know on the internet, but for a newbie like me im finding it hard to just pull out the bits of info I need. I do have a limited background in Delphi programming, and I could do this task in Delphi no probs at all, but VBScript is confusing me a little.... Basically, I have a form in outlook with 4 pages to it. I have my own text boxes on the 2nd page, just for arguements sake, labelled TextBox1, TextBox2 etc....I need to have VBScript put a number into TextBox1 each time the form is opened. The number must be sequential from the one before. I thought the simplest method of doing this would be to have a text file, say C:\number.txt which would contain the starting number, say 1000. Then, when the form is opened, VBScript will read the file, put the number (1000) into TextBox1, then increment the number by 1, then write the new number to the file in place of the old one. Thus, the next time the form is opened, the number 1001 will be put into TextBox1, and then incremented by 1 and written back to the file as 1002 etc etc. The main problem i'm having is acessing the TextBox1.Value property. In Delphi, i would just write TextBox1.Value = <variable> and that would be that. VBScript cant seem to find just TextBox1 and I dont understand much about classes and object etc, thus I cant point VBScript to the TextBox1.Value property. I also havent really palyed around with reading and writing the numbers to the C:\number.txt file. I found a great article on how to do this with VBA, but havent tried it in VBScript. Also, when I was palying round earlier, I kept getting the expected end of statement error, and all i had entered was dim test As String. I would be very greatful if someone could give me some pointers as to how to go about writing some script that would perform the task outlined above. Im sure it is simple in practice, but for a newbie like me, even the simplest things seem challenging. IM willing to learn but I cant seem to always get my answers from tutorials on the net. The other task I was hoping to perform with VBScript was to, on the event of a buttton being clicked, have VBScript copy all the fields of my custom form, send them to Microsoft Word, place the values into fields set out in a template with the same field names, then print it all out. But that's a whole new kettle of fish im sure. Thanks in advance to anyone who can help, your efforts wont go unoticed as your names shall appear in the "credits" section of my custom forms. Cheers Rob
|
|