Hi All

I Was hoping you could help. I'm no expert with VBA but I have been trying to achieve something where on clicking the button it saves the form I made in Word as a PDF in a predefined folder with the date. It then saves the PDF in the destination folder, closes the word document and does not save changes (ensurer the next user finds a blank form to use and prevents others from saving over it).

See the code below for the VBA script to save as PDF and close. I now want to further develop it 2 ways - 1) is before emailing have an otion box saying Caution this will send email. Is the document ready?" On Yes it will send the email and on No it will close the vba and go back to the word document.

Please can you help me write the code for it to open outlook and attach the PDF and send the email it saved with the file name (based on Text added to the document) to the file location "D:\Home\AirDocuments\S20 spray"

Im really struggling with it


Private Sub CommandButton1_Click()


Shapes(1).Visible = msoFalse


With ActiveDocument
  .SaveAs2 FileName:="D:\Home\AirDocuments\" & "\S20 Spray\" & "Checklist " & _
    .SelectContentControlsByTitle("Flight")(1).Range.Text & Space(5) & _
       Format(Now(), "dd-mm-yyyy") & ".PDF", _
    FileFormat:=wdFormatPDF
  
      .Shapes(1).Visible = msoTrue
      
      MsgBox "File saved to D:\Home\AirDocuments\S20 spray\"
      MsgBox "File will close!"
    Application.Documents.Close SaveChanges:=wdDoNotSaveChanges
End With
End Sub