K
Ken Kee via OfficeKB.com
I want to be able to change the file path from the default "My documuent"
path to something like "e:\test\doc\", see the codes below:
private void WordDialog()
{
object m = Type.Missing;
Word.Dialog dlg =
thisApplication.Dialogs
[Word.WdWordDialog.wdDialogFileOpen];
Type dlgType = typeof(Word.Dialog);
string path = selectedServerPath;
// Set name property of dialog box.
dlgType.InvokeMember("Name",
System.Reflection.BindingFlags.SetProperty |
System.Reflection.BindingFlags.Public |
System.Reflection.BindingFlags.Instance,
null, dlg, new object[] {"e:\\test\\doc\\*.doc"});
// Display dialog box.
dlg.Show(ref m);
Close();
}
The code still gives me the "My documuent" path, when this method is
called. How can I fix it? Thanks.
path to something like "e:\test\doc\", see the codes below:
private void WordDialog()
{
object m = Type.Missing;
Word.Dialog dlg =
thisApplication.Dialogs
[Word.WdWordDialog.wdDialogFileOpen];
Type dlgType = typeof(Word.Dialog);
string path = selectedServerPath;
// Set name property of dialog box.
dlgType.InvokeMember("Name",
System.Reflection.BindingFlags.SetProperty |
System.Reflection.BindingFlags.Public |
System.Reflection.BindingFlags.Instance,
null, dlg, new object[] {"e:\\test\\doc\\*.doc"});
// Display dialog box.
dlg.Show(ref m);
Close();
}
The code still gives me the "My documuent" path, when this method is
called. How can I fix it? Thanks.