{oapdf_gg}
Office software is closely linked to the PDF,the PDF is also must have to control!      Set home Page  Add to Favorites  
You are here:Home > OA application skills > POWERPOINT skills
POWERPOINT skills
PowerPoint using VBA to achieve production of a small test tutorial
Finishing by: Date:2010-06-30 10:53:57 Popularity: Tags:

This article is based on PowerPoint, VBA to create intelligent physical classroom quiz example.

this case is very simple, on two questions: as shown below, is the subject of options and a button, a title in the final pages where the "next question" button to "score" button.
can see from the interface, we need a text box, four option buttons and a command button. Function I want to click "Next Question" button, the interface will go to the next question; click the "Score" button, the result text box will show the test results on it. In this case the two issues were the correct option "B", "C".

production steps are as follows:

1, run PowerPoint2003, click "File" - "Save" command to bring up the "Save As" dialog box, the file name set to "test", click "Save" command.

2, click the "Insert" - "Text Box" - "level" command, then the mouse becomes "1" type, in the editing area click the left mouse button drag the mouse pulled a box Enter the first title in the subject box "1. man-made earth satellite orbit radius, then."

3, we have to produce the following options. Click the "View" - "Toolbars" - "Control Toolbox" command to bring up the "Control Toolbox", click "Control Toolbox" on the "Options button" control, the mouse into a cross-type, press the mouse left click the mouse pulled out a box. Click the "Control Toolbox" on the "Properties" command to bring up the "Properties" dialog box, the "name" to "ti1", the "caption" to "A. The smaller the velocity, the smaller the cycle", the other Set as default. As shown below.

the name of the other three options were "ti2", "ti3", "ti4", "caption" were "B. The smaller the velocity, the greater cycle", "C. the greater the speed, cycle smaller "," D. greater speed, greater cycle. "

4, "next question" button in the making. Click the "Control Toolbox" in the "command button" control, when the mouse into a cross-shaped, as in the editing area before dragging a box, release the mouse will turn into a button box. Select it, right-click the shortcut in the pop-up menu, select "properties" command, the "order button" properties "caption" set "the next question."

this way, the first question of the interface on the production is complete. The second question we can do step out in accordance with section 2-4, but should be subject, a change in the value of each option, a text box to add another command, the name set to "sum", the command button's name to "score . " $ Show_page $

add the code

1, click "Control Toolbox" on the "View Code" control, pop-up "Microsoft visual basic" editor, click the "Insert" - "module" command, the pop-up "modules" edit window, in the "module" Editor window enter "public fen (2) as integer".

2, select the first title in the "next question" button, click "Control Toolbox" on the "View Code" control, pop-up "Microsoft visual basic" editor, in the "Private Sub CommandButton1_Click ()" and "End Sub" between the input

If ti2.Value = True Then
fen (0) = 2
Else
fen (0) = 0
End If
With SlideShowWindows (1). View
. GotoSlide (2)
End With

3, select the last question in the "Score" button, click "Control Toolbox" on the "View Code" control, pop-up "Microsoft visual basic" editor, in the "Private Sub CommandButton1_Click ()" and "End Sub "between the input

If ti3.Value = True Then
fen (1) = 2
Else
fen (1) = 0
End If
Dim i, s
s = 0
For i = 0 To 2
s = s + fen (i)
Next
sum = s

there isArticle InformationsComment Information
Category column

Site Help | Site Map | Feedback |
OAPDF.COM Copyright 2009 V1.1