Consulting

Results 1 to 8 of 8

Thread: Add "Print" button to my msg box

  1. #1

    Add "Print" button to my msg box

    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!

  2. #2
    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

  3. #3
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    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

  4. #4
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    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
    Attached Files Attached Files

  5. #5
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,646
    That's a lot of code for a simple task.
    Attached Files Attached Files

  6. #6
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    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

  7. #7
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,646
    @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.

  8. #8
    Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •