a VBA RegEx question

  • Thread starter Thread starter Geoff Cox
  • Start date Start date
G

Geoff Cox

Hello,

I am trying to find internal hyperlinks in ppt files.

MsgBox "SubAddress " & oHl.SubAddress

does show the SubAddress and it has a commas in it but when I use

If oHl.SubAddress Like "," Then
MsgBox "SubAddress " & oHl.SubAddress
End If

this does not work.

I guess my RegEx line, with the

Like ","

is wrong some how?

Ideas please?!

Cheers

Geoff
 
Hello,

I am trying to find internal hyperlinks in ppt files.

It seems that Like requires an exact fit?

so, using

if oHl.SubAddress like "262,5,Fred" then
MsgBox oHl.SubAddress
End if

works,

but how do I use RegEx to look for a SubAdress with a comma in it?

if oHl.SubAddress like "," then
MsgBox oHl.SubAddress
End if

does not work.

Cheers

Geoff
 
but how do I use RegEx to look for a SubAdress with a comma in it?

if oHl.SubAddress like "," then
MsgBox oHl.SubAddress
End if

Looks like the answer is the * wild card as

if oHl.SubAddress like "*,*" then
MsgBox oHl.SubAddress
End if

works!

Geoff
 
Looks like the answer is the * wild card as

if oHl.SubAddress like "*,*" then
MsgBox oHl.SubAddress
End if

works!

Very good! Neat trick ... I didn't know that one.

You can also do:

If Instr(oHl.SubAddress,",") > 0 Then
 
Very good! Neat trick ... I didn't know that one.

You can also do:

If Instr(oHl.SubAddress,",") > 0 Then

Steve,

Thanks for that - will anyone write a book on the details of the VBA
language?! An O'Reilly type book would be excellent!

Cheers

Geoff
 
Steve,

Thanks for that - will anyone write a book on the details of the VBA
language?! An O'Reilly type book would be excellent!

All this stuff is plain old VB, really. The VBA language, for all intents and
purposes other than the ones I leave out, is garden variety VB plus special
knowledge of the application that VBA is implemented in. A book on VBA would
really be on VB (and there are plenty of those already) plus details on the
object models of PPT, Word, Excel, Outlook, CorelDraw, Visio .... et al.

It'd be expensive, what with the needed crane and rigging required to lift it.
;-)
 
All this stuff is plain old VB, really. The VBA language, for all intents and
purposes other than the ones I leave out, is garden variety VB plus special
knowledge of the application that VBA is implemented in. A book on VBA would
really be on VB (and there are plenty of those already) plus details on the
object models of PPT, Word, Excel, Outlook, CorelDraw, Visio .... et al.

It'd be expensive, what with the needed crane and rigging required to lift it.
;-)

OK - I'd better take a look at a VB book.

Cheers

Geoff
 
Back
Top