How to check for Bolded character is a text Box?

G

Guest

I face a problem in detecting bold data in a shape

ActiveSheet.Shapes("Text Box 17").Select
MsgBox Selection.Characters(Start:=i, Length:=1).Font.FontStyle

when i use this similiar code to detect bolded character in a cell, it works
fine.
but when i use this code to detect bolded data in a text box or rectangle
shape
the error " invalid use of null message" appear

how to check bolded data in a shape in Excel 2000
 
K

keepITcool

normally you'll get the null if you want to return a property
for multiple characters with different formatting.

but as you found within textframes the Fontstyle seems buggy.
However the Bold/Italic etc properties work correctly

Sub foo()
Dim o As Object, f As Font
Set o = Sheet1.Shapes(1).TextFrame
Set f = o.Characters(1, 1).Font
Msgbox f.Bold & vblf & f.Italic

End Sub




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Laguna wrote :
 

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