+ Reply to Thread
Results 1 to 2 of 2

How to check for Bolded character is a text Box?

  1. #1
    Laguna
    Guest

    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. #2
    keepITcool
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1