Click to See Complete Forum and Search --> : MSWord in CreateProcess


Burlacu Ovidiu
July 29th, 1999, 01:30 AM
I wanna open from my app a new .doc file based on Word Template make it by me(say reports.dot)
I've tried:

STARTUPINFO startup;
PROCESS_INFORMATION process;
CString p ="c:\\program files\\Microsoft Office\\Office\\Winword.exe /n c:\\work\\reports\\reports.dot";
memset( &startup, 0, sizeof( startup ) );
startup.cb = sizeof( startup );
memset( &process, 0, sizeof( process ) );
BOOL tSuccess = CreateProcess( NULL, (char*)(LPCSTR)p, NULL, NULL, FALSE,
0, NULL, NULL, &startup, &process );
HWINSTA sta = GetProcessWindowStation();
if( tSuccess )
{
// Close the handles that CreateProcess returned so we don't leak
// kernel resources.
ASSERT( process.hProcess != NULL );
CloseHandle( process.hProcess );
ASSERT( process.hThread != NULL );
CloseHandle( process.hThread );
}




But is open Word and window is named reports.dot, so is open my dot not a new doc based on my dot.
What is wrong?

Thx,
Ovidiu