Click here to Skip to main content
15,899,026 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CFileFind Pin
locoone30-Oct-06 14:07
locoone30-Oct-06 14:07 
GeneralRe: CFileFind Pin
Stephen Hewitt30-Oct-06 14:19
Stephen Hewitt30-Oct-06 14:19 
GeneralRe: CFileFind Pin
Stephen Hewitt30-Oct-06 14:26
Stephen Hewitt30-Oct-06 14:26 
QuestionExcel Page Pin
roadme25-Oct-06 11:26
roadme25-Oct-06 11:26 
AnswerRe: Excel Page Pin
freeman86825-Oct-06 16:59
freeman86825-Oct-06 16:59 
GeneralRe: Excel Page [modified] Pin
freeman86825-Oct-06 17:01
freeman86825-Oct-06 17:01 
GeneralRe: Excel Page Pin
roadme27-Oct-06 8:42
roadme27-Oct-06 8:42 
GeneralRe: Excel Page Pin
roadme27-Oct-06 9:00
roadme27-Oct-06 9:00 
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;
}

QuestionReading from File question... [modified] Pin
q_p25-Oct-06 11:20
q_p25-Oct-06 11:20 
AnswerRe: Reading from File question... Pin
led mike25-Oct-06 11:34
led mike25-Oct-06 11:34 
GeneralRe: Reading from File question... Pin
q_p25-Oct-06 11:40
q_p25-Oct-06 11:40 
GeneralRe: Reading from File question... Pin
Zac Howland25-Oct-06 11:47
Zac Howland25-Oct-06 11:47 
GeneralRe: Reading from File question... Pin
led mike25-Oct-06 11:49
led mike25-Oct-06 11:49 
AnswerRe: Reading from File question... Pin
Zac Howland25-Oct-06 11:45
Zac Howland25-Oct-06 11:45 
GeneralRe: Reading from File question... Pin
led mike25-Oct-06 12:01
led mike25-Oct-06 12:01 
GeneralRe: Reading from File question... Pin
Zac Howland25-Oct-06 12:53
Zac Howland25-Oct-06 12:53 
GeneralRe: Reading from File question... Pin
q_p25-Oct-06 12:16
q_p25-Oct-06 12:16 
GeneralRe: Reading from File question... Pin
Zac Howland25-Oct-06 12:55
Zac Howland25-Oct-06 12:55 
GeneralRe: Reading from File question... Pin
ThatsAlok25-Oct-06 20:57
ThatsAlok25-Oct-06 20:57 
GeneralRe: Reading from File question... Pin
Stephen Hewitt25-Oct-06 15:12
Stephen Hewitt25-Oct-06 15:12 
GeneralRe: Reading from File question... Pin
Zac Howland26-Oct-06 3:59
Zac Howland26-Oct-06 3:59 
GeneralRe: Reading from File question... Pin
ThatsAlok25-Oct-06 20:51
ThatsAlok25-Oct-06 20:51 
GeneralRe: Reading from File question... Pin
Zac Howland26-Oct-06 4:03
Zac Howland26-Oct-06 4:03 
QuestionRe: Reading from File question... Pin
David Crow26-Oct-06 4:34
David Crow26-Oct-06 4:34 
AnswerRe: Reading from File question... Pin
Zac Howland26-Oct-06 4:51
Zac Howland26-Oct-06 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.