View Full Version : Centering Text in a Message Box

09-12-2007, 06:19 AM
really simple question.

Can I centre the text in a standard msgbox or do I have to produce a userform to have centered text?

If the former is possible how do i do this?

Thanks in advance

PS Sorry for the spelling mistake in the title!

09-12-2007, 06:42 AM
I think you can do it using windows hooks, but it's probably easier to create your own userform.

09-12-2007, 06:54 AM
Fair enough, I shall create a userform then, which should nicely keep me occupied till tea time.

By the way, I have no idea what windows hooks are, do you have time for a quick explination?

09-12-2007, 06:55 AM
spelling in title corrected.
You can edit your own thread and change the title I think.

09-12-2007, 07:02 AM
There's a very good and, as it happens, on-topic explanation here (http://vbnet.mvps.org/index.html?code/hooks/messageboxhook.htm)

09-12-2007, 07:10 AM
Rory: thanks for the link am reading it now (or will be when I've finished writing this.

Lucas: Thanks for changing the title, have figured out how to edit the post itself but couldn't see how to edit the title, so thanks

09-12-2007, 12:50 PM
I "know" Colo has some code to centre (spelling is correct so please leave it !) text in message boxes, I seem to recall it uses fonts and places text temporarily in a cell to get the required spacings, go to JMT at http://www.puremis.net/excel/cgi-bin/yabb/YaBB.pl and look in the addins section.

09-12-2007, 12:54 PM
spelling is wrong and it's the wrong color :devil2:

09-12-2007, 01:04 PM
It's not coloured it's in plain Aluminium finish !

09-12-2007, 01:08 PM
good one...:)