Hi all,

Basically I need to be able to open a word document, be presented with an open dialog box, select a csv file and then use that csv file as the data source for mail merge. So far I have the following:



Code:
Private Sub Document_Open()

    Const msoFileDialogOpen = 1
    
    Set objWord = CreateObject("Word.Application")
    
    objWord.ChangeFileOpenDirectory ("C:\")
    
    objWord.FileDialog(msoFileDialogOpen).Title = "Select the CSV file to be merged"
    objWord.FileDialog(msoFileDialogOpen).AllowMultiSelect = False
    
    
    If objWord.FileDialog(msoFileDialogOpen).Show = -1 Then
        objWord.WindowState = 2

    End If

End Sub

And that's as far as I am, I need to add a filter as well so the user can only select CSV files. Pulling the file name back out is causing me a lot of problems when it shouldn't really be too difficult! Please any help would be greatly appreciated.