Hi Guys
I require Please help me with this macro.

This macro creates an email in lotus notes, attaching a cell range, you can edit information and add addresses in Lotus Notes program.

What I require is that instead of attaching the cell range I attach a file. Pdf that generates macro myself.

I hope I can help.

Thanks

Option Explicit
 
'Function for finding the first top level window in the windows list
'that meet the criteria.
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
      (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
 
 
Sub Send_Formatted_Range_Data()
   Dim oWorkSpace As Object, oUIDoc As Object
   Dim rnBody As Range
   Dim lnRetVal As Long
 
   Const stTo As String = "Excel@Microsoft.com"
   Const stCC As String = "Lotus Notes@IBM.com"
   Const stBody As String = vbCrLf & "As per agreement." & vbCrLf _
         & "Kind regards" & vbCrLf & "Dennis"
   Const stSubject As String = "Report xxx"
   Const stMsg As String = "An e-mail has been succesfully created and saved."
 
   'Check if Lotus Notes is open or not.
   lnRetVal = FindWindow("NOTES", vbNullString)
 
   If lnRetVal = 0 Then
      MsgBox "Please make sure that Lotus Notes is open!", vbExclamation
      Exit Sub
   End If
 
   Application.ScreenUpdating = False
 
   'A named range in the activesheet is in use.
   Set rnBody = ActiveSheet.Range("Report")
   rnBody.Copy
 
   'Instantiate the Lotus Notes COM's objects.
   Set oWorkSpace = CreateObject("Notes.NotesUIWorkspace")
 
   On Error Resume Next
   Set oUIDoc = oWorkSpace.ComposeDocument("", "mail\xldennis.nsf", "Memo")
   On Error GoTo 0
 
   Set oUIDoc = oWorkSpace.CurrentDocument
 
   'Using LotusScript to create the e-mail.
   Call oUIDoc.FieldSetText("EnterSendTo", stTo)
   Call oUIDoc.FieldSetText("EnterCopyTo", stCC)
   Call oUIDoc.FieldSetText("Subject", stSubject)

   'If You experience any issues with the above three lines then replace it with:
   'Call oUIDoc.FieldAppendText("EnterSendTo", stTo)
   'Call oUIDoc.FieldAppendText("EnterCopyTo", stCC)

   'Call oUIDoc.FieldAppendText("Subject", stSubject)
   
   'The can be used if You want to add a message into the created document.
   Call oUIDoc.FieldAppendText("Body", vbNewLine & stBody)
 
   'Here the selected range is pasted into the body of the outgoing e-mail.
   Call oUIDoc.GoToField("Body")
   Call oUIDoc.Paste

   'Save the created document.
   Call oUIDoc.Save(True, False, False)
   'If the e-mail also should be sent then add the following line.
   'Call oUIDoc.Send(True)
 
   'Release objects from memory.
   Set oWorkSpace = Nothing
   Set oUIDoc = Nothing
 
   With Application
      .CutCopyMode = False
      .ScreenUpdating = True
   End With
 
   MsgBox stMsg, vbInformation
 
   'Activate Lotus Notes.
   AppActivate ("Notes")
 
End Sub