0

I'm trying to write a basic function to check if the text in a cell is bolded, but I keep getting the mentioned runtime error on the second line. I've looked up various documentations and tried other permutations of this code including declaring V as a variant, object etc... I'm still not sure what's wrong.

Image for reference

Function IsBold(V)

    If V.CharWeight = com.sun.star.awt.FontWeight.BOLD Then
        IsBold = "TRUE"
    Else
        IsBold = "FALSE"
    End If
    
End Function
1
  • 2
    The code works, so it must be an issue with the passed parameter. Edit the post to include the call and how the object was defined. For example, oVC = ThisComponent.getCurrentController().getViewCursor(); MsgBox IsBold(oVC). Commented Apr 3 at 15:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.