Office 2003 - adding a file extension to the "files of type" drop down menu in outlook

Posted on 2006-05-25
Last Modified: 2010-05-18
Win Xp / Office 03 - I'd like to add a file extension to the "files of type" section of the insert file menu from within outlook. I know I proably will have to do a little registry hacking but I'm not sure of the path.

Any help is greatly appreciated!
Question by:bamcguire
    LVL 6

    Accepted Solution

    My guess is that the file type information is hard coded in C:\Program Files\Common Files\Microsoft Shared\Office10\1033\MSOINTL.DLL

    If your intent is to modify the list for the purposes of attaching files to e-mails (and I am assuming you are using Word as your editor), then I don't think you will be able to add to the list just by editing the registry. I think that your best bet will be to trap the opening of the File Open dialog by substituting your own command for the file open event. Then open your own version of the file dialog instead of letting the system do it.

    A tip for creating your own macro to replace a built-in word function is here:'s_Built-in_Commands.html

    I created a replacement for the InsertFile command in Normal.DOT. InsertFile is what is run when you use Insert, File... in Word. The following macro was inserted in the NewMacros module

    Option Explicit

    Sub InsertFile()
    ' InsertFile Macro
    ' Inserts the text of another file into the active document

    End Sub

    I am assuming this is the first macro you are creating, so I show the Option Explicit, which I suggest you make the first line if it isn't already there (there is a configuration option to set to get this automatically).

    I converted the macro to this

    Sub InsertFile()
    ' InsertFile Macro
    ' Inserts the text of another file into the active document
       Dim MyFileDialog As Office.FileDialog
       Dim MyFileOpenDialog As Dialog
       Dim MyFilter As FileDialogFilter
       'Add a "Music Filter" to FileDialog(msoFileDialogOpen) as the second on the list
       Set MyFileDialog = Application.FileDialog(msoFileDialogOpen)
       Set MyFilter = MyFileDialog.Filters.Add("Music Files", "*.mid;*.wav", 2)
       'Choose the Music Files filter to be the one displayed.
       MyFileDialog.FilterIndex = 2
       'Show the dialog
       'Remove the added filter so only the standard filters remain.
       If MyFilter.Description = MyFileDialog.Filters(2).Description Then
          Call MyFileDialog.Filters.Delete(2)
       End If
       'Take the first selected item and put it in the built-in Insert File dialog and execute
       Set MyFileOpenDialog = Dialogs(wdDialogInsertFile)
       MyFileOpenDialog.Name = MyFileDialog.SelectedItems(1)
    End Sub

    I could not find an easy way to modify the filter list in Dialogs(wdDialogInsertFile), so instead I showed FileDialog(msoFileDialogOpen) dialog, which is very similar. Then I took the selected file from that dialog and inserted it into the Dialogs(wdDialogInsertFile) dialog and executed it without showing it.

    You would have to modify other procedures for File Open or whatever dialog opens in Outlook to attach a file in a similar way.

    Author Comment

    Thanks for the help Garlin007 - that seems to have done the trick. Its a shame there's no easier way to reslove the issue but...what ever works :)

    Thanks again - it looks like you put out some real effort to help me reslove my problem and its a appreciated.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction Perhaps more familiar to developers who primarily use VBScript than to developers who tend to work only with Microsoft Office and Visual Basic for Applications (VBA), the Dictionary is a powerful and versatile class, and is useful …
    How many times recently have you prepared a presentation or emailed a document to a client and you have found that they have older versions of MS Office and they can not open the file you have prepared.  Although most visitors to this site are exper…
    The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
    Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now