• MsgBox text centring (Word ’97 VBA)

    Author
    Topic
    #361670

    Can anyone tell me if it’s possible to centre text in a msgbox?

    Example:

    MsgBox “This will search the current document and highlight jobs in bold for clarity.” & Chr$(13) & _
    “Click OK to continue”

    All I’m looking for is the second row of text to be centred instead of l-aligned.

    Viewing 1 reply thread
    Author
    Replies
    • #547414

      I don’t think that there is a way to center text in a MsgBox, since MsgBox is only a quick solution to give out messages.
      If you want to generate formatted output, you should use a user form. In a user form you can simply use two different label fields, one left aligned and one centered underneath.

    • #547444

      Hi,
      Sadly, not as far as I know – you can right-align it, but not centre it (unless you go Al’s route of adding spaces.) I’d agree with hedgehog – a simple userform is probably your best bet.

      • #547641

        Hey-ho, never mind.

        I think Al’s “add spaces” idea will do for a bodge. It doesn’t need to be too pretty this time.

        Cheers folks!

    Viewing 1 reply thread
    Reply To: MsgBox text centring (Word ’97 VBA)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: