启动Outlook并打开现有邮件

时间:2016-11-28 14:00:00

标签: objective-c macos command-line outlook office365

我需要在我的应用中通过ID在Outlook中打开现有邮件。这是否可以在osx上使用?

当前代码:

NSString* mailID = ...
...
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
NSURL *url = [NSURL fileURLWithPath:[workspace fullPathForApplication:@"Microsoft Outlook.app"]];
NSError *error = nil;
NSArray *arguments = [NSArray arrayWithObjects:@"", @"", nil];
[workspace launchApplicationAtURL:url options:0 configuration:[NSDictionary dictionaryWithObject:arguments forKey:NSWorkspaceLaunchConfigurationArguments] error:&error];
if (error) {
    NSLog(@"%@", error.description);
}

0 个答案:

没有答案