Document User Instructions

Home Up Odds & Ends Photo Gallery Search Contact Me

 

 

The information in this website is provided without risk or obligation and free of charge.  However, if you have benefitted from my efforts here and would like to make a contribution to help me continue and maintain this work then any donation will be greatly appreciated. Please click the adjacent button to access PayPal.  Thank you.
 
Let's say that you have created a template for completing a lease agreement and you want to provide users with a few instructions for completing the agreement that are not a part of the actual document.  A simple AutoNew macro MsgBox can get you started:

To create the above message box place the following code in a AutoNew Macro stored in the template project:
Sub AutoNew()

Dim Inst As VbMsgBoxResult
On Error Resume Next
Inst = MsgBox("Complete blocks 1-34 and sign in block 35. Incomplete lease" & _
                           " appliations will not be accepted.", vbOKOnly, "Instructions")
End Sub
Want to get a little fancier?  Use an Assistant Balloon and the code below:

Sub AutoNew()

Dim Balloon As Balloon

Set Balloon = Assistant.NewBalloon
With Balloon
.Heading = "{cf 252} Instructions"
.Text = "Complete blocks 1-34 and sign in block 35. Incomplete lease applications will not be accepted."
.Button = msoButtonSetOK
.Animation = msoAnimationGetAttentionMajor
.Show
End With

End Sub

Note:  The Microsoft Office 11 Object Library and the Microsoft Office Assistant must be enabled to use the Office Assistant balloon. 

You can use the either the message box or ballon method above in other macros throughout the document.  Let's say that block 12 of your lease application requires amplifying instructions.  You can use a macrobutton in the document to key users to refer to additional instructions:

Block 12.  Mother's maiden name: ___________________________ "Double Click here for amplifying instructions."

A sample MacroButton field looks like this:

 

When field code is toggles the MACROBUTTON field displays:  

The result:

Using this code:
Sub MaidenNamePopUp()

Dim Balloon As Balloon

Set Balloon = Assistant.NewBalloon
With Balloon
.Heading = "{cf 249} Mandatory Information"
.Text = "Everyone has a mother. You can not leave this block blank."
.Button = msoButtonSetOK
.Animation = msoAnimationGetAttentionMajor
.Show
End With

End Sub
You can also run similar macros as "on entry" or "on exit" events in form fields.  With the Form unprotected, double click the formfield to display the Options dialog box below.  The first sample below runs the MaidenNamePopUp macro used above.

The following sample runs an "on exit" macro named "OopsBlankField" to detect a blank mandatory field
The code:

Sub OopsBlankField()

Dim Balloon As Balloon

With ActiveDocument
  If .FormFields("SSN").Result = "" Then
     Set Balloon = Assistant.NewBalloon
     With Balloon
        .Heading = "{cf 249} Blank Field Detected"
        .Text = "You can not leave this field blank. Please enter your social " & _
                     "security number."
        .Button = msoButtonSetOK
        .Animation = msoAnimationGetAttentionMajor
        .Show
    End With
  End If
End With

End Sub

The result if the formfield named "SSN" is blank is:

A built in method for providing amplifying information in forms is the "Add Help Text" formfield option.  With the form unprotected, double click the field to display the Options dialog box.  Click on the "Add Help Text" and enter the user help text which appears on the the Status Bar when the field is entered.


Looking for something else?

Google