Perhaps I didn't explain myself fully. I have to prepare and distribute the
minutes of a weekly meeting that I chair. The meetings are numbered
sequentially, and the number appears in various places in the document, hence
the prompt, and I place a DOCVARIABLE in those places in the document where
they are needed.
If, by mistake, a wrong meeting number is entered or a null value is
entered, I want to be able to error trap those conditions. I don't know the
syntax to accomplish this.
I hope this is clearer now.
Compass Rose was telling us:
Compass Rose nous racontait que :
> Perhaps I didn't explain myself fully. I have to prepare and
> distribute the minutes of a weekly meeting that I chair. The meetings
[quoted text clipped - 7 lines]
>
> I hope this is clearer now.
You were perfectly clear.
What Helmut wanted to know were the parameters to use for the logic that
will be needed to decide if a given number is acceptable.
For example, the following are numbers, but probably unacceptable as meeting
numbers: "123.45", "-56" or "567,678".
In any case, here is a sample that accepts any number..
Dim lngMeet As Variant
Dim boolOK As Boolean
Do
lngMeet = InputBox("Meeting Number")
'lngMeet = "" when user clicks on "Cancel"
If lngMeet = "" Then Exit Sub
If Not IsNumeric(lngMeet) Then
MsgBox "You must type a valid standard number."
boolOK = False
Else
boolOK = True
ActiveDocument.Variables("varmeetingnumber").Value = CStr(lngMeet)
End If
Loop While Not boolOK

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Compass Rose - 04 Oct 2006 06:44 GMT
Merci beacoup, Jean-Guy. This does exactly what I want.
However, I found one small glitch. I changed
If Not IsNumeric(lngMeet) Then
to
If Val(lngMeet) <> Int(Val(lngMeet)) Then
Thanks again,
David
> Compass Rose was telling us:
> Compass Rose nous racontait que :
[quoted text clipped - 35 lines]
> End If
> Loop While Not boolOK