A family of Microsoft word processing software products for creating web, email, and print documents.
Just get rid of the extra .Me in that line. In fact, you can get rid of all the Me's, because they're optional in a simple case like this.
The code for the button (usually labeled OK) that closes the userform can be this:
Private Sub cmdOK_Click()
Dim strCaption As String
If optB.Value = True Then
strCaption = optB.Caption
ElseIf optC.Value = True Then
strCaption = optC.Caption
Else
strCaption = optD.Caption
End If
ActiveDocument.Variables("Class").Value = strCaption
Me.Hide
End Sub