Here I share the function of Word pages to everybody. //This function shows how to get the pages of word int Wordpage(char* wordfile) { int page; CoInitialize(NULL); _Application app; app.CreateDispatch(_T("Word.Application")); app.SetVisible(FALSE); Documents docs=app.GetDocuments(); CComVariant FileName(wordfile); CComVariant ConfirmConversions(false); CComVariant ReadOnly(false),AddToRecentFiles(false); CComVariant PasswordDocument(_T("")),PasswordTemplate(_T("")); CComVariant Revert(false),WritePasswordDocument(_T("")); CComVariant WritePasswordTemplate(_T("")), Format(0); CComVariant Encoding(false),Visible(TRUE); CComVariant OpenAndRepair(false),DocumentDirection(false); CComVariant NoEncodingDialog(false); CComVariant XMLTransform(_T("")); docs.Open(&FileName,&ConfirmConversions,&ReadOnly, &AddToRecentFiles,&PasswordDocument, &PasswordTemplate, &Revert, &WritePasswordDocument,&WritePasswordTemplate, &Format, &Encoding, &Visible, &OpenAndRepair,&DocumentDirection, &NoEncodingDialog, &XMLTransform); _Document doc=app.GetActiveDocument(); Range rang=doc.GetContent(); page=rang.GetInformation (4).lVal;//get pages rang.ReleaseDispatch(); doc.ReleaseDispatch(); docs.ReleaseDispatch(); CComVariant SaveChanges(false),OriginalFormat,RouteDocument; app.Quit(&SaveChanges,&OriginalFormat,&RouteDocument); app.ReleaseDispatch(); return page; }