Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    North Providence, Rhode Island, USA
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Disabling Email in Word (Office 2000 Word)

    Is there a way to shut off the access in the toolbar to the e-mail icon and capability on the standard toolbar. I realize I can remove it by using view, toolbars and customize, however, I want to disable the entire function related to it working in Word. Using it in a classroom situation, leaves the door open to cheating and I would like to disable the function.

  2. #2
    JustCallMeAl
    Guest

    Re: Disabling Email in Word (Office 2000 Word)

    From what you said about your application, removing the icon would be removing the function.

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    North Providence, Rhode Island, USA
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Disabling Email in Word (Office 2000 Word)

    I realize that, however, students know how to customize their tool bars, therefore enabling them to go back and restore the function. Is there a way to totally disable the function from accessing the e-mail function?

  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: Disabling Email in Word (Office 2000 Word)

    You can intercept the "ID" for these commands (Send to Mail Recipient, Send to Mail Recipient as attachment) and tell Word to ignore them. You can do this in Normal.dot or in an add-in. The drill is something like this:

    (1) Create an object module (I named mine clsLounge) and put in:

    Option Explicit
    Public WithEvents App As Word.Application
    Public WithEvents SendMail As CommandBarButton
    Public WithEvents SendAsAttach As CommandBarButton

    (2) In a regular module, create a variable to point to your class module:

    Dim AppEvents As New clsLounge

    (3) Capture one or more events and set up your command intercepts:

    In clsLounge:

    Private Sub App_DocumentOpen(ByVal Doc As Document)
    Call SetIntercept
    End Sub

    Private Sub App_NewDocument(ByVal Doc As Document)
    Call SetIntercept
    End Sub

    In a regular module:

    Sub SetIntercept()
    'locate Send to submenu
    Dim cbCtl As CommandBarControl, cbPop As CommandBarPopup
    For Each cbCtl In Application.CommandBars("File").Controls
    If cbCtl.ID = 30095 Then
    Set cbPop = cbCtl
    Exit For
    End If
    Next
    'assign event procedure for Send to Mail Recipient
    Dim ctlBtn As CommandBarButton
    Set ctlBtn = cbPop.CommandBar.FindControl(ID:=3738)
    Set AppEvents.SendMail = ctlBtn
    'assign event procedure for Send to Mail Recipient as attachment
    Set ctlBtn = cbPop.CommandBar.FindControl(ID:=2188)
    Set AppEvents.SendAsAttach = ctlBtn
    End Sub

    (4) Disable the buttons in clsLounge:

    Private Sub SendMail_Click(ByVal Ctrl As Office.CommandBarButton, _
    CancelDefault As Boolean)
    CancelDefault = True
    End Sub

    Private Sub SendAsAttach_Click(ByVal Ctrl As Office.CommandBarButton, _
    CancelDefault As Boolean)
    CancelDefault = True
    End Sub

    (5) Finally, create two (or three) auto macros to fire up the event handlers (in a regular module):

    Sub AutoNew()
    Set AppEvents.App = Word.Application
    End Sub

    Sub AutoOpen()
    Set AppEvents.App = Word.Application
    End Sub

    Sub AutoExec()
    Set AppEvents.App = Word.Application
    End Sub

    (There might be another way to do this involving ThisDocument, but I didn't see it immediately in the help.)

    The net result of all this is that in a newly opened or newly created document, the mail button and the menu items should simply do nothing. Students could defeat this if they carefully prevent any of the auto macros from running, but that seems unlikely. They also could rename Normal.dot, but perhaps you can reduce the likelihood of that by making it read only. You could implement the event handlers in a COM Add-in, but I think these could be easily disabled in the Templates and Add-ins dialog. Hope this helps.

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Location
    North Providence, Rhode Island, USA
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Disabling Email in Word (Office 2000 Word)

    Thanks! Giving it a try one 2 stations to see if we have any problems--so far so good.
    Thanks!

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Disabling Email in Word (Office 2000 Word)

    Jefferson,

    Does your code do the same thing as this: ?

    application.commandbars("Menu Bar").Controls("&File").controls("Sen&d To").Controls("&Mail Recipient...").enabled = false
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  7. #7
    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: Disabling Email in Word (Office 2000 Word)

    Mmmmmaybe. Honestly, this event stuff is such a headache that if you say so, I'll take your word for it. I think one difference would be that intercepting by ID is not (or should not be) sensitive to where something is in the menus/toolbars. One advantage of the Enable = False method, though, is that the user has a visual cue that the command won't work. A "no-op" procedure like the one I proposed doesn't do that.

Posting Permissions

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