Undocumented AFX function : AfxGetClassIDFromString

CAbsWordMngt::CAbsWordMngt()
{
CString strVersion;
CLSID clsid;

CoInitialize(NULL);

m_Version = 9;
if ( AfxGetClassIDFromString(“Word.Application.9”, &clsid) )
{
m_Version = 8;
if ( AfxGetClassIDFromString(“Word.Application.8”, &clsid) )
{
m_Version = 0;
AfxMessageBox(“WinWord version 8 or 9 not installed …”);
return;
}
}
}

More by Author

Must Read