PDA

View Full Version : [SOLVED] Add "Print" button to my msg box



nirvehex
11-28-2014, 09:57 AM
Hi I have a code:



Sub ScopeofWorkInstructions()


MsgBox " SCOPE OF WORK INSTRUCTIONS:" _
& vbNewLine & " " _
& vbNewLine & "1. Please fill out as much information as possible." _
& vbNewLine & " " _
& vbNewLine & "2. Use the Notes column for additional information discussed." _
& vbNewLine & " " _
& vbNewLine & "3. Download the Client's Logo and insert it as a picture, sized to fit within the logo box" _
& vbNewLine & " " _
& vbNewLine & "4. Please return to the Navigation and check the completion box when finished."


End Sub


I have two questions.

1. Can I change the standard "OK" to say something else in the msg box?
2. Can I add a print button which will print what's in the msgbox?

Thank you!

ashleyuk1984
11-28-2014, 01:46 PM
I don't think you can change the default message box settings.
You will need to create a simple userform (which looks like a message box) instead. It's very easy :)

Charlize
11-29-2014, 04:11 AM
It's possible to change the standard text on the buttons of a messagebox.
Yes, if you can do the first question.

Have to look through my archives but I remember me that I did something (long ago) for a dentist who needed a material ordering system.

Charlize

Charlize
11-29-2014, 07:02 AM
Ok, I've created a little example how to create a messagebox with the text on the buttons that you would like to have. Text on the buttons is limited.
There are two routines in this excel book. One is to leave it alone. This one contains all the mumbo jumbo to make it possible to change the default messagebox. It's the original coding from Ivan Moala.
Other module is the one where you may tinker with the code to create your program. This module is called "Example_MSGBOX".
You can see the resulting msgbox by using alt + F8 and run your macro.

I hope it's usefull for you.

Charlize

snb
11-29-2014, 08:01 AM
That's a lot of code for a simple task.

Charlize
11-29-2014, 08:39 AM
Well, I just answered his question :) . I believe there used to be even a colored messagebox routine. Not sure if I still have that one.

Charlize

snb
11-29-2014, 09:14 AM
@Charlize

Yes you did; and it's very helpful you did (Although I wouldn't assume the OP to be a male). :)

Nevertheless it might be worth while to compare both solutions in terms of functionality and amount of code to accomplish that.

nirvehex
12-01-2014, 08:55 AM
Thank you!