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 / October 2006

Tip: Looking for answers? Try searching our database.

VBA Find will not return NOTHING

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christopher King - 13 Oct 2006 19:12 GMT
An add-in I've created worked fine in PowerPoint 2003, but gave an error in
PowerPoint 2007, B2TR.  The cause appears to be that Find does not return
NOTHING if the search string is not found.  Here's the example from Help:
  Set txtRng = shp.TextFrame.TextRange
  Set foundText = txtRng.Find(FindWhat:="CompanyX")
  Do While Not (foundText Is Nothing)
      With foundText
          .Font.Bold = True
          Set foundText = _
              txtRng.Find(FindWhat:="CompanyX", _
              After:=.Start + .Length - 1)
      End With
  Loop

I got my code to work by replacing
  Do While Not (foundText Is Nothing)
with
  Do While Not (foundText = "")
Looks like this is a bug in VBA:  when the search text is not found, the
variable is set to "", rather than NOTHING.

Chris
Shyam Pillai - 15 Oct 2006 02:02 GMT
This is a bug in 2007 confirmed.

Signature

Regards,
Shyam Pillai

Animation Carbon
http://www.animationcarbon.com

> An add-in I've created worked fine in PowerPoint 2003, but gave an error
> in
[quoted text clipped - 29 lines]
>
> http://www.microsoft.com/office/community/en-us/default.mspx?mid=5820fa3b-7919-4
4fa-baef-2a55f89495cc&dg=microsoft.public.powerpoint
 
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.