If Statement

B

Brenda A. Reid

Word XP

I have a vba userform in a template and one of the questions on the form is
"One
or more classes of shares?" The choices are one of two optionbuttons One or
More than one. This is so I can automate the wording in the template to
either singular or plural.

Optionbuttons:
FrmStage2.sharess
FrmStage2.sharesp

Document/Template:
RESOLVED: that the form of share certificate{if frmState2.sharesp =
True "s"}and
blank ensorsement thereon, etc.

Logically I would use the above code but of course it doesn't work. This
should automatically add an s to the word certificate.

Desperate Brenda
 
D

Doug Robbins - Word MVP

Where you want either certificate or certificates to appear in the document,
insert a { DOCVARIABLE varcertificate } field and in the userform code, use
the following

With ActiveDocument
If sharess.value = True then
.Variables("varcertificate").Value = "certificate"
Else
.Variables("varcertificate").Value = "certificates"
End If
.Range.Fields.Update
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top