Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How to check for Bolded character is a text Box?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default How to check for Bolded character is a text Box?


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 :

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 - Formatting text in cell (character by character) TomC Excel Discussion (Misc queries) 0 January 29th 10 07:25 PM
Text changing colour when bolded? Frax315 Excel Discussion (Misc queries) 3 August 21st 08 08:11 PM
Bolded Text To Column henrikb Excel Worksheet Functions 0 March 20th 06 01:35 PM
check if the text string start with a specific character September21 New Users to Excel 5 September 22nd 05 03:07 PM
how to sort list, bolded items from no bolded? tcd50 Excel Discussion (Misc queries) 1 July 9th 05 10:29 PM


All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"