|
-
May 7th, 2002, 09:58 AM
#2
Re: Firing up a Microsoft word document
to fire up a word document, I think this would work...
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInfo;
memset(&StartupInfo, 0, sizeof(StartupInfo));
memset(&ProcessInfo, 0, sizeof(ProcessInfo));
if(CreateProcess(
NULL,
"\"C:\\Program Files\\Microsoft Office\\Office\\winword.exe\" c:\\somedir\\doc1.doc",
NULL,
NULL,
FALSE,
CREATE_DEFAULT_ERROR_MODE,
NULL,
NULL,
&StartupInfo,
&ProcessInfo) == FALSE)
{
// Error
// Wait until application has finished
WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
AfxMessageBox("Could not open file!");
// Application has finished...
}
notice how c:... and winword.exe has quotes around it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|