Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

How to center a line of text in a message box? Code included

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
charlie6067 - 11 Oct 2006 16:51 GMT
I have code that displays the standard message box but I want to center
the third line of text over the OK button. Is that possible? Or, are
there VBA characters that can be used to push the text right to the
desired position? Many thanks for your help.

Charlie
charlie6067

Option Explicit

Sub DatePlus2()
' Message box displays information about the Date calulation field.

Dim DatePlus2 As String

   MsgBox "To calculate the next field, add 2 years to the above
Effective Date field" & Chr(13) & Chr(13) & _
          "and subtract 1 day. For example, if the Effective Date was
July 15, 2000, the" & Chr(13) & Chr(13) & _
          "correct date for the next field would be July 14, 2002." &
Chr(13) & Chr(13) & _
          "Effective Date + 2 years - 1 day."

End Sub
Greg Maxey - 11 Oct 2006 17:02 GMT
You could use vbTab or perhaps use a userform instead of the message
box.  See:

http://gregmaxey.mvps.org/Custom_MsgBox.htm

> I have code that displays the standard message box but I want to center
> the third line of text over the OK button. Is that possible? Or, are
[quoted text clipped - 20 lines]
>
> End Sub
charlie6067 - 11 Oct 2006 17:11 GMT
Hi Greg,

Thank you as that was exactly what I was looking for. And, that was the
best instruction page I've seen in a a long while - great graphics and
layout! I'm going to share it with my design team.

Thanks again,
Charlie
charlie6067

> You could use vbTab or perhaps use a userform instead of the message
> box.  See:
[quoted text clipped - 25 lines]
> >
> > End Sub
Greg Maxey - 11 Oct 2006 17:27 GMT
Glad I could help and thanks for the compliment.

> Hi Greg,
>
[quoted text clipped - 35 lines]
> > >
> > > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.