a VBA RegEx question

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
 
G

Geoff Cox

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
 
G

Geoff Cox

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
 
G

Geoff Cox

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
 
G

Geoff Cox

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
 

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