How to skip the New Document dialog
Posted
by Petr Stejskal
on December 9th, 1998
There is a simple way how to go round the dialog which appears when your app uses more than one document template and you click the 'new' button. You can open any document directly. Here is a small example of function which opens all documents from your document template at once.
void CMyApp::OnOpenAllTypesOfDocuments()
{
POSITION pos = GetFirstDocTemplatePosition();
CDocTemplate* pTemplate = GetNextDocTemplate(pos);
pTemplate->OpenDocumentFile(NULL); // creates the first document
pTemplate = GetNextDocTemplate(pos);
pTemplate->OpenDocumentFile(NULL); // creates the second document
// etc...
}

Comments
There are no comments yet. Be the first to comment!