Jump to content

agregar codigo para archivo adjunto LOTUS


Recommended Posts

Posted

Ya realice un codigo en donde ya manda el correo y manda un rango de celdas pero necesito que ese mismo archivo de donde saco el rango de celdas se adjunte en el correo.

Espero me puedan ayudar ya que llevo casi 2 dias intentandolo.



rivate Sub Si_Click()
Dim NSession As Object
Dim NDatabase As Object
Dim NUIWorkSpace As Object
Dim NDoc As Object
Dim NUIdoc As Object
Dim quienes(0) As Variant





Set NSession = CreateObject("Notes.NotesSession")
Set NUIWorkSpace = CreateObject("Notes.NotesUIWorkspace")
Set NDatabase = NSession.GetDatabase("", "")

If Not NDatabase.IsOpen Then
NDatabase.OPENMAIL
End If

'Create a new document

Set NDoc = NDatabase.CreateDocument

With NDoc
.SendTo = Sheets("Tablas").Range("A1").Value 'CHANGE THIS
.CopyTo = CC
.Subject = "REPORTE DE LOS SOLVENTES " & Now

'Email body text, including marker text which will be replaced by the Excel cells

.body = "" & vbNewLine & vbNewLine & _
"**PASTE EXCEL CELLS HERE**" & vbNewLine & vbNewLine


.Save True, False
End With

'Edit the just-created document to copy and paste the Excel cells into it

Set NUIdoc = NUIWorkSpace.EDITDocument(True, NDoc)
With NUIdoc

'Find the marker text in the Body item

.GotoField ("Body")
.FINDSTRING "**PASTE EXCEL CELLS HERE**"
'.DESELECTALL 'Uncomment to leave the marker text in place (cells are inserted immediately before)

'Replace it with the Excel cells

Sheets("ACTUALIZACIONDESOLVENTES").Range("A1:J71").Copy 'CHANGE THIS
.Paste
Application.CutCopyMode = False


.Send
.Close
End With

Set NSession = Nothing

Unload Me
End Sub

[/CODE]

  • 2 weeks later...
Posted

Prueba agregando

.Attachments.Add ActiveWorkbook.FullName

antes de .Send

Al menos así lo he hecho yo, ojalá te sirva.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

Privacy Policy