Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / August 2006

Tip: Looking for answers? Try searching our database.

a VBA RegEx question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Geoff Cox - 14 Aug 2006 09:23 GMT
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
Geoff Cox - 14 Aug 2006 09:43 GMT
>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
Geoff Cox - 14 Aug 2006 12:26 GMT
>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

>does not work.
>
>Cheers
>
>Geoff
Steve Rindsberg - 16 Aug 2006 04:38 GMT
> >but how do I use RegEx to look for a SubAdress with a comma in it?
> >
[quoted text clipped - 9 lines]
>
> works!

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

You can also do:

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

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
Geoff Cox - 16 Aug 2006 08:27 GMT
>> >but how do I use RegEx to look for a SubAdress with a comma in it?
>> >
[quoted text clipped - 15 lines]
>
>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 Rindsberg, PPT MVP
>PPT FAQ:  www.pptfaq.com
>PPTools:  www.pptools.com
>================================================
Steve Rindsberg - 16 Aug 2006 19:56 GMT
> >> if oHl.SubAddress like "*,*" then
> >> MsgBox oHl.SubAddress
[quoted text clipped - 12 lines]
> 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.  
;-)
Geoff Cox - 16 Aug 2006 21:26 GMT
>> >> if oHl.SubAddress like "*,*" then
>> >> MsgBox oHl.SubAddress
[quoted text clipped - 21 lines]
>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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.