Go4Expert (http://www.go4expert.com/)
-   MFC (http://www.go4expert.com/forums/mfc/)
-   -   Word Automation Using MFC (http://www.go4expert.com/forums/word-automation-using-mfc-t22773/)

DeepthiC85 21Jul2010 15:44

Word Automation Using MFC
I am trying to add different header and footer to the first page of the document using Word Automation in VC++. My code is not erroring out but I am not able to achieve the target. Can someone please help me how to resolve the issue?

I am providing the code snippet below -

MSWORD97_View view;
PageSetup pagesetup;
window.AttachDispatch(finalDocument.GetActiveWindo w());

//To insert page header -- The below code inserts header text for me.
const long wdSeekCurrentPageHeader = 9;

window.AttachDispatch(finalDocument.GetActiveWindo w());
selection.PasteSpecial(covOptional, covOptional, covOptional, covOptional, covOptional, covOptional, covOptional) ;

//PageSetUp -- I am not able to Set the option in the PageSetUp window of the Header&footer one //

const long nNewValue = 8;
pagesetup.AttachDispatch(finalDocument.GetPageSetu p());

Can someone please correct the code or let me know whats wrong in the above. I am also not able to get what value should be passed to SetDifferentFirstPageHeaderFooter?:confused:

Please help!!!!!!!:disappoin

All times are GMT +5.5. The time now is 00:07.