SignatureProvider.ShowSignatureSetup method (Office)
Provides a signature provider add-in the opportunity to display the Signature Setup dialog box to the user.
Syntax
expression.ShowSignatureSetup(ParentWindow, psigsetup)
expression An expression that returns a SignatureProvider object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
ParentWindow | Required | IOleWindow | Contains the handle to the window containing the Signature Setup dialog box. |
psigsetup | Required | SignatureSetup | Specifies initial settings of the signature provider. |
Remarks
This method is used for both the insertion time configuration process and if a user later wants to re-configure the signature line. You display the Signature Setup dialog box during this callback and wait for the user to select OK or Cancel.
It's not necessary to display a dialog box for signature setup unless you specifically need information from the author about the signature line. If you can provide all of the necessary details back to Microsoft Office without user input, no dialog is necessary.
Example
The following example, written in C#, shows the implementation of the ShowSignatureSetup method in a custom signature provider project.
public void ShowSignatureSetup(object parentWindow, SignatureSetup sigsetup)
{
bool firstInit = string.IsNullOrEmpty(sigsetup.AdditionalXml);
if (sigsetup != null && !sigsetup.ReadOnly && firstInit)
{
sigsetup.SigningInstructions = "Please sign this document.";
sigsetup.ShowSignDate = true;
sigsetup.AdditionalXml = "<TestSignatureData />";
}
using (Win32WindowFromOleWindow window = new Win32WindowFromOleWindow(parentWindow))
{
using (SignatureSetupForm sigsetupForm = new SignatureSetupForm(sigsetup))
{
sigsetupForm.ShowDialog(window);
if (!sigsetupForm.success && firstInit)
throw new System.Runtime.InteropServices.COMException("Canceled", -2147467260 /*E_ABORT*/);
}
}
}
Note
Signature providers are implemented exclusively in custom COM add-ins and cannot be implemented in Microsoft Visual Basic for Applications (VBA).
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for