SignatureLine.Sign Method
Displays the Sign dialog box with the specified signature image or stamp, and the suggested signer name, title, and e-mail address.
Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)
Syntax
'Declaration
Public MustOverride Function Sign ( _
imageUrl As String, _
suggestedSigner As String, _
suggestedSignerTitle As String, _
suggestedSignerEmail As String _
) As Boolean
'Usage
Dim instance As SignatureLine
Dim imageUrl As String
Dim suggestedSigner As String
Dim suggestedSignerTitle As String
Dim suggestedSignerEmail As String
Dim returnValue As Boolean
returnValue = instance.Sign(imageUrl, _
suggestedSigner, suggestedSignerTitle, _
suggestedSignerEmail)
public abstract bool Sign(
string imageUrl,
string suggestedSigner,
string suggestedSignerTitle,
string suggestedSignerEmail
)
Parameters
imageUrl
Type: System.StringThe path to the signature or stamp image to display in the control.
suggestedSigner
Type: System.StringThe name of the suggested signer.
suggestedSignerTitle
Type: System.StringThe title of the suggested signer.
suggestedSignerEmail
Type: System.StringThe e-mail address of the suggested signer.
Return Value
Type: System.Boolean
true if the signing operation succeeds; otherwise, false.
Remarks
The values for all of the parameters of the Sign(String, String, String, String) method are optional. To omit any parameter, pass a null reference (Nothing in Visual Basic) for that parameter. You can also pass String.Empty for the suggestedSigner, suggestedSignerTitle, and suggestedSignerEmail parameters. If you pass a null reference (Nothing in Visual Basic) or String.Empty for a parameter and the value of the corresponding property was previously set programmatically or in the Signature Line control at design time, that value will be used when the form or set of data is signed.
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.
Examples
The following code example accesses the first Signature Line control in the current view, and then calls the Sign(String, String, String, String) method to display the Sign dialog box for signing the entire form or set of data associated with the control. After the control is signed, the code displays a message box that shows the value of the SignatureAppearanceType property for the control.
SignatureLine mySignatureLine =
this.CurrentView.SignatureLines[0];
mySignatureLine.Sign(@"C:\Users\Larry\Pictures\MySignature.jpg",
"Larry Zhang", "Sales Associate", "larry@contoso.com");
MessageBox.Show(mySignatureLine.SignatureAppearanceType.ToString());
Dim mySignatureLine As SignatureLine = _
Me.CurrentView.SignatureLines(0)
mySignatureLine.Sign("C:\Users\Larry\Pictures\MySignature.jpg", _
"Larry Zhang", "Sales Associate", "larry@contoso.com")
MessageBox.Show(mySignatureLine.SignatureAppearanceType.ToString())