MFC: How to set header and footer for print preview (programmatically)?

无人久伴 提交于 2020-03-24 00:07:29

问题


Setting header and footer works for print using the following command where I add header and footer as parameters.

ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DODEFAULT, &parameters, NULL);

But I don't know how to do it for print preview and I don't seem to find relevant document about that. It seems header and footer can be set manually via OLECMDID_PAGESETUP, but first I don't want to bring up the UI during runtime (and OLECMDEXECOPT_DONTPROMPTUSER doesn't work somehow), and second I don't know how to set the parameters when calling OLECMDID_PAGESETUP.

Someone also suggests to set print template (https://groups.google.com/forum/#!topic/microsoft.public.windows.inetexplorer.ie5.programming.components.webbrowser_ctl/54f5-aQsk6A) without any detail and the reference link is broken.

来源:https://stackoverflow.com/questions/60419546/mfc-how-to-set-header-and-footer-for-print-preview-programmatically

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!