I am developing a C Sharp Word AddIn that acts the same as the File>Open option. The exception is that when I click on the AddIn, I want it to ask the user which file they want to open...

I have .NET Framework 4, Visual Studio 2010 and Word 2010.

Here is the code so far...

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Word = Microsoft.Office.Interop.Word;
using Office = Microsoft.Office.Core;
using Microsoft.Office.Tools.Word;
using System.IO;


namespace WordAddIn2
{
public partial class ThisAddIn
{
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
System.Console.Write("Enter the file name: ");
String fileName = System.Console.ReadLine();

Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();
Word._Document oDoc;
oDoc = oWord.Documents.Open(@"H:\SNH\" + fileName);
}

private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}

#region VSTO generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}

#endregion
}
}


When I add the AddIn to Word and try to run it, it produces an error saying "This file could not be found." However, it was supposed to ask the user which file to open and never did.