#1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Brenda A. Reid Brenda A. Reid is offline
external usenet poster
 
Posts: 8
Default If Statement

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


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default If Statement

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

"Brenda A. Reid" wrote in message
...
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



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
which statement right , question is Choose the correct statement? how many template?when we click new doc Microsoft Word Help 1 October 16th 06 11:15 AM
which statement right , question isChoose the correct statement? how many template?when we click new doc Microsoft Word Help 1 October 15th 06 11:20 PM
using iif statement Boots Mailmerge 3 June 19th 06 03:23 PM
If Then statement Brw Microsoft Word Help 2 June 9th 05 04:12 AM
OR statement JCSadie Mailmerge 7 April 26th 05 09:52 PM


All times are GMT +1. The time now is 05:57 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"