Click here to Skip to main content
15,886,795 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VC++ how to get EnhMetaFileBits of every word page

C++
CApplication wordApp;
 COleVariant vTrue((short)TRUE), vFalse((short)FALSE), vOpt((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
 CDocuments docxs;
 CDocument0 docx;
 CRange aRange;
 CString out_path=_T("C:\\Users\\Administrator\\Desktop\\test\\");

 docxs.ReleaseDispatch();

 try
 {
 CoInitialize(NULL);
 if(!wordApp.CreateDispatch(_T("Word.Application"),NULL))
 {
 AfxMessageBox(_T(it cant run")
 return ;
 }
 }
 catch(...)
 {
 return ;
 }



 docxs=wordApp.get_Documents();
 COleVariant vFileName(in_path); 
 docx=docxs.Open(vFileName,vFalse,vTrue,vFalse,vOpt,vOpt,vOpt,vOpt,vOpt,vOpt,vOpt,vOpt,vOpt,vOpt,vOpt,vOpt); 
 CWindows win=docx.get_Windows();
 CWindow0 window = wordApp.get_ActiveWindow();
 CPane0 pane = window.get_ActivePane();
 CPages pages = pane.get_Pages();
 long index=pages.get_Count();

 for(long i=1;i<=index;i++)
 {

 CPage page=pages.Item(index);(there is a error here,"The requested member of the collection does not exist")
......

 }


please help me,thanks in advance.
Posted
Updated 30-Oct-15 20:11pm
v2
Comments
enhzflep 31-Oct-15 1:10am    
Do not re-post questions, please.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900