"Do while not"

R

Roger Marrs

I am trying to figure out how to modify a routine that uses Do While Not.
The issue I'm dealing with is that Do While Not checks the validity of the
value contained in a bookmark against a mask. However, I need to accomodate
more than one mask.

For example:
Do While Not (CaseNumber Like "####-[A-Z][A-Z]-######-*")
OR
Do While Not (CaseNumber Like "####-[A-Z][A-Z]-######-A")

The solution is probably very simple, and I'm trying make it too difficult.

Roger
 
D

Doug Robbins - Word MVP

If it is really the content of a bookmark that you are testing against, as a
bookmark can only appear once in a document, it seems to me that and
If...Then...Else If...Then...End If construction would be more appropriate.

--
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
 
R

Roger Marrs

Thanks Doug. It really is a bookmark that I'm testing against and I think
your suggested solution will work. I was trying to figure out an
If...Then.... Else in conjunction with the Do While Not... and was getting
nowhere.

Roger

Doug Robbins - Word MVP said:
If it is really the content of a bookmark that you are testing against, as a
bookmark can only appear once in a document, it seems to me that and
If...Then...Else If...Then...End If construction would be more appropriate.

--
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

Roger Marrs said:
I am trying to figure out how to modify a routine that uses Do While Not.
The issue I'm dealing with is that Do While Not checks the validity of the
value contained in a bookmark against a mask. However, I need to
accomodate
more than one mask.

For example:
Do While Not (CaseNumber Like "####-[A-Z][A-Z]-######-*")
OR
Do While Not (CaseNumber Like "####-[A-Z][A-Z]-######-A")

The solution is probably very simple, and I'm trying make it too
difficult.

Roger
 

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