You are invited to Log in or Register a free Frihost Account!

Microsoft Word Documents & Visual Basics

Ok maybe someone can help me with this, within microsoft word documents you can use VB scripting. For my work i have created a test for my employes to take and i have created drop down box's ect. Could i add a VB script within this word doc to make it grade itself? Im sure i could im just not to fimiliar with VB at this time i just started the training for VB and only in the second chapter Smile if someone could help me out with this it would be more then appreicated, This is needed really badly for my work.

You guys are lifesavers Smile thanks in advanced

You can definitely do it, but in order to write any code for you i'd need some specifics, ie the name of each combobox, the type of data you are expecting for validation purposes, some sort of scoring/marking system for the test etc.

Give me a bit more info and i'll be able to help you, should be pretty straightforward Smile
could you just do it with examples such as "example box1" ect. and ill change those later as they will be changed every time. As far as the scoring system i want to do it as a % of correct answers. And i understand that you will prolly need the coorect answers as theres no other way to tell if the answer provided is correct so again could you simply write it out with examples and ill change all that later on, these tests are going to be distributed weekly and will allways change. Also im not sure exactly what questions we are going to provide in the current test.
This looks like an easy one (says who has made some extenesive VBA programming at work). Anyway, my suggestion is:
1. Write your code for the onchange event of the combo boxes or the onclick event for the command buttons. (These are the default events, so double-clicking on a control will pop up VBA Editor with
Sub ComboBox1_onchange
End Sub

already filled in.
2. You can simply test the answers like
if combobox1.value="the correct answer" then counter=counter+1

Just make sure that you hide your VBA code (Tools - Project Properties - Protection), and give a password twice. Ah yes, and don't forget it!
If you have further questions, I will help you! And do not fear of experimenting! (on a copy of your original file, of course...)
Good luck!
Related topics
A "small" list of free apps
Programming links, info, and tutorials
microsoft word bug
Microsoft vs. open-source in file sizes
Clean HTML from MS Word, possible?
[Visual Basics] Putting Program into SysTray?
German Dictionary for Microsoft Word
how to check if a file exists. please help (visual basics 6)
Visual Basics total online players?
why does microsoft word create HTML pages with so many tags?
Word 2007 Problem
To Upgrade or Not to Upgrade?
How to get a word 2003 .doc file onto website
Replacement for Microsoft Word for some tasks
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

© 2005-2011 Frihost, forums powered by phpBB.