""Peter Huang" [MSFT]" wrote:
> Hi Andy,
>
> Based on my understanding, you want to know if it's possible to customize
> the footer information when calling the Webbrowser control's ExecWB to
> print from you VB.NET application. The footer information can be set in the
> 3rd parameter for ExecWB. The problem is this parameter is a Variant of
> type VT_ARRAY. Its structure is described here:
>
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrows
> er/reference/methods/execwb.asp
>
> "If pvaIn is a VARIANT of type VT_ARRAY, pvaIn specifies a SAFEARRAY
> containing (in the following order) a header BSTR, a footer BSTR, the
> address of an IStream pointer for a Microsoft Outlook Express header
> document, an alternate URL BSTR used for MSHTML in Outlook Express, and a
> DWORD containing flags."
>
> Unfortunately, this is not currently possible using only VB.NET or C#.
>
> Technically, these languages do not support a syntax that would allow one
> to create a parameter of type VARIANT (.vt = VT_BYREF|VT_VARIANT)
> referencing a
> VARIANT (.vt = VT_ARRAY|VT_VARIANT), i.e. a SAFEARRAY of VARIANT wrapped up
> in a by-ref VARIANT. This is the mandatory type of the third parameter in
> the method in question, whose IDL is shown below.
> HRESULT ExecWB(
> [in] OLECMDID cmdID,
> [in] OLECMDEXECOPT cmdexecopt,
> [in, optional] VARIANT* pvaIn,
> [in, out, optional] VARIANT* pvaOut);
>
> In general, your only option is to create an unmanaged (e.g. C++ or VB6)
> wrapper library. And then call the C++ wrap library in .NET.
> Here is a link about how to do print customized footer and header in C++.
>
> How To Print Custom Headers and Footers for a WebBrowser Control
>
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q267240 >
>
> Hope this helps.
>
> Best regards,
>
> Perter Huang
> Microsoft Online Partner Support
>
> Get Secure! -
www.microsoft.com/security > This posting is provided "AS IS" with no warranties, and confers no rights.
>