Home

MacOffice

This site will look better if you upgrade to a browser that supports web standards.

Automatically add a file to the Work menu

This technique is useful for ensuring that an add-in (or other file) is automatically added to the Work menu. Put this in a regular code module in the add-in:

    Public Sub AutoExec()
        WorkMenuItems.Add ThisDocument
    End Sub

or regular document:

    Public Sub AutoOpen()
        WorkMenuItems.Add ThisDocument
    End Sub

To then automatically unload the add-in/file from the Work menu:

    Public Sub AutoExit()
        Dim i As Long
        For i = 1 To WorkMenuItems.Count
            With WorkMenuItems(i)
                If ThisDocument.FullName = .Path & _
                   Application.PathSeparator & .Name Then _
                        .Delete
            End With
        Next i
    End Sub

Valid XHTML 1.1 Valid CSS Made on a Macintosh

Quick Links

Remove items from the Work menu

Save items to a text file.

Download the jemWordWorkMenu add-in

About add-ins