Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-25-2012, 05:46 AM
ibrahimaa ibrahimaa is offline Message Box Windows Vista Message Box Office 2007
Advanced Beginner
Message Box
 
Join Date: May 2011
Posts: 35
ibrahimaa is on a distinguished road
Default Message Box

Is keep spaces is the only way to start a new row in the message box or there is another way?


Also, how can I make a part of the message content bold or change the font size & color?
Can I insert a small table (3 columns & 3 rows) in the message box? Thank you.
Code:
Call MsgBox("You Are Not Authorized and you need to -------", vbExclamation, "Warning")
Reply With Quote
  #2  
Old 02-25-2012, 06:42 PM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Message Box Windows 7 32bit Message Box Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

To start a new line in the message box you can use carriage return/linefeed characters. I tend to use vbNewLine:
Code:
MsgBox "hello" & vbNewLine & "the" & vbNewLine & "world!"
For more information on vbNewLine, have a look in the VBA helpfile.


To make part of the message content bold or format the size and colour, you have two choices.
(1) Use some very complicated API calls
(2) Instead of using the built-in messagebox, create your own userform to display the message.

Option (2) is very simple and is the one I recommend. It would also be easy to have a table on your userform.
Reply With Quote
  #3  
Old 02-25-2012, 09:18 PM
ibrahimaa ibrahimaa is offline Message Box Windows Vista Message Box Office 2007
Advanced Beginner
Message Box
 
Join Date: May 2011
Posts: 35
ibrahimaa is on a distinguished road
Default

Colin,
I do really appreciate your help. Can you please advise me on links where I can learn about userform? Thank you.
Reply With Quote
  #4  
Old 02-26-2012, 02:32 PM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Message Box Windows 7 32bit Message Box Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

Hi,

Perhaps this you tube video will help as a starting point:

http://www.youtube.com/watch?v=5PN7lWJSobQ

To begin with, you will be particularly interested in Label controls which will let you write your message on the userform.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Message Box Message Header ritjohns Outlook 1 11-16-2011 01:20 PM
Message Box Proofing message geralds34 Word 2 05-02-2011 06:07 PM
Message Box Autoforward message 400ex4ever Outlook 1 01-06-2011 07:50 PM
Pop Up Message on Open Emma Samm Word 0 12-20-2010 02:38 PM
Error message White House Outlook 1 12-07-2010 04:52 AM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 07:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft