获取Office安装路径

Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.LocalMachine;
Microsoft.Win32.RegistryKey regSubKey = regKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\winword.exe", false);
string OfficePath = Path.GetDirectoryName(regSubKey.GetValue("").ToString())+@"\STARTUP";

posted @ 2012-06-25 08:15  xyzla  阅读(770)  评论(0编辑  收藏  举报