delphi - How to use OleVariant parameters to TWebBrowser Print dialog? -


i'm trying implement custom headers , footers when printing twebbrowser, per information in microsoft knowledge base question. knowledgebase article quite helpful , includes lengthy code example, however, code example in c++ not delphi, i've had attempt convert necessary data structure delphi code myself. i'm not terribly confident i've correctly converted part of code need.

here's important part of article, explains supposed go in paramater vain in code below:

when use olecmdid enumeration of olecmdid_print element execwb method, can specify extended printing information passing in safearray structure through variant argument pvain. safearray data type takes maximum of 5 items:

1) string (bstr) contains custom header. 2) string (bstr) contains custom footer. 3) ... 

when run code i've written, removes original header , footer, not replace new header , footer strings, i'm wondering if code incorrect in way (or several ways), or if shouldn't expect work since i'm using ie 9 , not version in 4-6 range current @ time knowledgebase article written.

var   vain, vaout: olevariant; begin     vain := vararraycreate([0,1], varolestr);      vain[0] := varastype('new header', varolestr); //header     vain[1] := varastype('new footer', varolestr); //footer      // show print-preview dialog      webbrowser1.controlinterface.execwb(olecmdid_printpreview,       olecmdexecopt_dontpromptuser, vain, vaout); end; 


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -