![]() |
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()); view.AttachDispatch(window.GetView()); //To insert page header -- The below code inserts header text for me. const long wdSeekCurrentPageHeader = 9; view.SetSeekView(wdSeekCurrentPageHeader); window.AttachDispatch(finalDocument.GetActiveWindo w()); selection.AttachDispatch(window.GetSelection()); 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()); pagesetup.SetDifferentFirstPageHeaderFooter(4); 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 23:55. |