instr function

Status
Not open for further replies.
J

Joel Allen

Outlook 2003 SP3

Hi,

I'm trying to find * and ? in the string. Do I have to do two separate if

statements, or can I use some kind of OR statement? This isn't working:

If Instr(1, Item.UserProperties("JobName"), "*" or "?", vbTextCompare) > 0

Then

MsgBox "Sorry, you cannot use the * or ? character"

Exit Sub

end if

Thanks,

Joel
 
S

Salad

Joel Allen wrote:


> Outlook 2003 SP3

> Hi,

> I'm trying to find * and ? in the string. Do I have to do two separate if
> statements, or can I use some kind of OR statement? This isn't working:

> If Instr(1, Item.UserProperties("JobName"), "*" or "?", vbTextCompare) > 0
> Then

> MsgBox "Sorry, you cannot use the * or ? character"

> Exit Sub

> end if

> Thanks,
> Joel

>


x = "Joe Blow"

? (ubound(split(x,"*")) or ubound(split(x,"?"))) > 0 'False

x = "Joe*Blow"

? (ubound(split(x,"*")) or ubound(split(x,"?"))) > 0 'True

x = "Joe Blow?"

? (ubound(split(x,"*")) or ubound(split(x,"?"))) > 0 'True

x = "Joe*Blow?"

? (ubound(split(x,"*")) or ubound(split(x,"?"))) > 0 'True

Or you could use Instr() but 2 separate comparisons as well.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
L Outlook saved template function too limited Using Outlook 2
R Creating a user defined function Outlook VBA and Custom Forms 3
J Copy to calendar function no longer working in outlook 365 Using Outlook 5
J autocomplete function in custom form Using Outlook 1
A How to assign the value returned by the regex execute function to a variable? Using Outlook 1
B Search function in Office 365 has stopped working Using Outlook 3
T Query About "Delay Delivery" Function Using Outlook 5
M Constant indexing/no search function Using Outlook 0
B Search function "to: ONLY Bob" Using Outlook 1
K Outlook 2007 Calendar - Time spinner does not function correctly Using Outlook 1
B The “run a script” function stopped unexpectedly in Outlook2007 Using Outlook 6
R searching a not function Using Outlook 2
E Outlook 2007 backup and restore function Using Outlook 2
R Serach Function Using Outlook 3
S Error from Folder.MoveTo function Outlook VBA and Custom Forms 2
M DASL Filter function? Outlook VBA and Custom Forms 3
M DASL Filter function? Outlook VBA and Custom Forms 3
M Today(S) function in DASL Filter Outlook VBA and Custom Forms 1
M Today(S) function in DASL Filter Outlook VBA and Custom Forms 1
I Today function in Outlook Forms Outlook VBA and Custom Forms 1
J Include calculations in the lookup function Outlook VBA and Custom Forms 1
B Outlook Script ( using calendar function in a form) Outlook VBA and Custom Forms 3
S VSTO calling unmanged function Outlook VBA and Custom Forms 3
A Programmatically duplicating BCM's "Link to Record" function BCM (Business Contact Manager) 2
Z WebView doesnt function with separate pst Outlook VBA and Custom Forms 3

Similar threads

Top