How to read the word content by string wise i am able to open the doc but not able to read and comapre the string by string content plz help
// Create an instance of Word
if (!objWordApp.CreateDispatch("Word.Application"))
{
SendMessage(m_pFRMgr->m_hActiveDlg,WM_TR_READ,0,(LONG)(LPCSTR)m_pFRMgr->m_strErrMsg);
}
objWordApp.SetVisible(FALSE);
objDocs = objWordApp.GetDocuments();
//open the word file
lpDisp = objDocs.Open( COleVariant(strTRFile, VT_BSTR), covFalse,
covFalse,
covFalse,
covOptional,
covOptional,
covFalse,
covOptional,
covOptional,
covOptional
);
if(lpDisp == NULL)
{
if(objWordApp)
objWordApp.Quit(covFalse, covFalse, covFalse);
}
objDoc.AttachDispatch(lpDisp);
//Get word Source Doc ID:
objWords = objDoc.GetWords();
int sizeWords = objWords.GetCount();
CString strDocID;
bool bSource = false;
for(int cntWords=1; cntWords <= sizeWords; cntWords++)
{
Range objRange1;
CString strWord;
objRange1= objWords.Item(cntWords);
strWord = objRange1.GetText();
strWord.TrimLeft();
strWord.TrimRight();
if(strWord.CompareNoCase("Time") == 0)
break;
if(bSource && strWord.CompareNoCase(":") != 0)
strDocID += strWord;
}
Loading
Sebastian EddingtonPosted Mar 22, 2013, 1:14 AM
http://zirmandli.wordpress.com/2007/07/04/read-word-doc-using-c/
http://www.mindstick.com/Articles/019723e0-ec6c-4c95-a381-f40efba920f8/
http://www.microsoft.com/en-us/download/details.aspx?id=5124
http://eleriumsoft.com/Word_NET/WordReader/Examples/Read_Word_Document.aspx
Sukesh MarlaPosted Oct 14, 2012, 10:32 AM
http://www.programmerfish.com/quick-tutorial-how-to-read-microsoft-word-file-in-c/