TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sowbhagya aruna
NA
3
1.9k
How to read the word content by string wise
Oct 11 2012 7:49 AM
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;
}
Reply
Answers (
2
)
About generating classes of Datamatrix & pdf417 barcodes in C#.net
how to get online/offline mode Users in UserTable