开发者

open outlook without knowing the exact file path

开发者 https://www.devze.com 2023-03-28 23:18 出处:网络
is there a way in vb.net to open microsoft outlook without knowing the file path exactly? different versions of outlook use different file locations, then you have to worry about the program files an

is there a way in vb.net to open microsoft outlook without knowing the file path exactly?

different versions of outlook use different file locations, then you have to worry about the program files and program files(x86). is there a way to just launch outlook using the system.diagnostics.process.start("..") without the file path?

i dont want to have to test fol开发者_开发知识库ders:

If Folder_Exists("C:\Program Files\Microsoft Office\Office12") Then
If Folder_Exists("C:\Program Files\Microsoft Office\Office11") Then

thanks


As far as I know the Outlook exe directory should be on the system path. Shelling "Outlook" should start it.


I think Outlook path is exported, so running OUTLOOK.EXE as command (try Windows+R and executing it to make sure) should execute OutLook right away. To know which path is OutLook in, I don't know if Windows has something like Linux's which command.


It is on the system PATH so

System.Diagnostics.Process.Start("outlook")

You can also start outlook and launch a new email in one go

Process.Start("mailto:me@gmail.com?subject=HelloWorld")


Outlook is normally in the system PATH environment variable.

You can use System.Diagnostics.Process.Start with UseShellExecute = true to start it.

(Excuse my C#)

var processStartInfo = new ProcessStartInfo() { FileName = "outlook", UseShellExecute = true }
System.Diagnostics.Process.Start(processStartInfo)
0

精彩评论

暂无评论...
验证码 换一张
取 消