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
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.
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
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org