Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Nov 2003
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Message Box Macro (2003)

    I have an Excel document that when I open it, a message box pops up letting the editor know to send the revised copy to a certain person. Is there a way I can do this same function in Word?? I only want it to work with certain files and not all of them. Normally when I create a macro in Word, it seems to function with each document opened in Word. Any help would be appreciated.

    Here is the macro I use in Excel ...

    Private Sub Workbook_Open()
    MsgBox "If changes are made to this document, please e-mail file to Donn Bauerly for updating in Synergen."

    End Sub

    How can I accomplish the same thing in Word?

    Any help is greatly appreciated!!

    Thanks, Tammi

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Message Box Macro (2003)

    When you open the Excel sheet, does it prompt you to Disable or Enable macros, indicating that you have "Medium" macro security for Office?

    If No, perhaps your security is set on Low, which might not represent the normal setting for most people.

    If Yes, you can embed a macro in Word using the identical technique. Press Alt+F11 to open the Visual Basic Editor, and navigate to the ThisDocument object for your document (not for Normal.dot or the document's attached template). There create a Document_Open() macro. Does it work?

  3. #3
    New Lounger
    Join Date
    Nov 2003
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Message Box Macro (2003)

    My security is set to Medium and it does prompt me to Disable or Enable macros when I use Excel. So Excel works fine. I'm just not sure how to make it work in Word.

    I have the macro created as you've suggested, but nothing happens when I open the document. In the ThisDocument object in the VB Editor, I have:
    Private Sub Document_Open()
    MsgBox "If changes are made to this document, please e-mail file to Donn Bauerly for updating in Synergen."
    End Sub

    Does that command actually want to open a document??? If so, I'm just wanting a message to pop up, but when I open the document, nothing happens? What am I missing?

    Feel free to e-mail me direct if needed. I could send you a capture of what my screen looks like if needed.

    Your help is TRULY appreciated.

    Thanks, Tammi

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Message Box Macro (2003)

    Save the attached to your hard drive and see if the event fires when you open it. If not, it's possible that it is being overridden somehow. Either your macro security is higher in Word, or something else (perhaps a global template) is interfering.
    Attached Files Attached Files

  5. #5
    New Lounger
    Join Date
    Nov 2003
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Message Box Macro (2003)

    AAaahhhhh! Your document works! I went back and checked the security settings within Word itself, and they were set to "High". I was checking my system settings before. I did not realize that the Word security setting would override the system setting. So each program has it's own security settings ... I learned something new!!! But as always, the gurus have come through once again!!!

    Thanks for being there, and thanks TONS for all of your help!!!!!! You're great!!

    Tammi

Posting Permissions

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