Adding Signature to the end of Word document and sign it

bradyboyy88

Well-known Member
Joined
Feb 25, 2015
Messages
562
I am working on some code in excel vba and trying to open a word document, then add a signature to the bottom, sign it, then export it as as pdf. So far here is what I have:

Code:
Sub ExportSignedPDF
    'Open Word Doc 
    Dim WordApp As Word.Application
    Dim WordDoc As Word.Document
    Set WordApp = CreateObject("Word.Application")
    Set WordDoc = WordApp.Documents.Open("c:/user/blahblah.docx")
    Dim n As Long
    
    'Delete any comments
    Dim oComments As Object
    Set oComments = WordDoc.Comments
    
    For n = oComments.Count To 1 Step -1
        oComments(n).Delete
    Next 'n

   'Add signature and sign it with user information -- Need Help



    'Remove track changes
    WordDoc.Revisions.AcceptAll
  
    'Create PDF -- Need Help


    WordApp.Documents.Save 
    WordApp.Quit 
        
    Set oComments = Nothing
    Set WordDoc = Nothing
    Set WordApp = Nothing

End Sub

I am using the following methodology to add the signature but the problem is it requires the user to hit enter to verify the details. Is there a method to do that automatically?

Code:
Sub Macro1()
    Dim mysignature1 As Signature
    Set mysignature1 = ActiveDocument.Signatures.AddSignatureLine("{00000000-0000-0000-0000-000000000000}")
    mysignature1.Setup.SuggestedSigner = "Name"
    mysignature1.Setup.SuggestedSignerLine2 = "Project Manager"
    mysignature1.Setup.SuggestedSignerEmail = "email@domain.com"
    
End Sub
 
Last edited by a moderator:

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,223,768
Messages
6,174,414
Members
452,562
Latest member
Himeshwari

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top