Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

mandar correo con archivo adjunto

publicado

Buenos días a todos los expertos: Siguiendo las indicaciones de Macro Antonio he encontrado esta macro a través del google, pero mis conocimientos no llegan a entedender como adaptarla a mis necesidades. La macro es esta: Public Function sendEmail(ByVal senderAddress As String, _

ByVal destinataryAddress As String, _

Optional ByVal subject As String = "", _

Optional ByVal body As String = "", _

Optional ByVal CC As String = "", _

Optional ByVal BCC As String = "", _

Optional ByVal password As String, _

Optional ByRef cdoConfig As Object) As Boolean

On Error GoTo errorSection

Dim cdomsg As Object

Dim result As Boolean

Set cdomsg = CreateObject("CDO.Message")

If cdoConfig Is Nothing Then

Select Case True

Case senderAddress Like "*@gmail.*"

Set cdoConfig = newCdoConfig(smtpserver:="smtp.gmail.com", _

smtpserverport:=465, _

sendusername:=senderAddress, _

sendpassword:=password)

Case senderAddress Like "*@hotmail.*" Or _

senderAddress Like "*@live.*" Or _

senderAddress Like "*@msn.*" Or _

senderAddress Like "*@outlook.*"

Set cdoConfig = newCdoConfig(smtpserver:="smtp.live.com", _

smtpserverport:=25, _

sendusername:=senderAddress, _

sendpassword:=password)

Case senderAddress Like "*yahoo.*"

Set cdoConfig = newCdoConfig(smtpserver:="smtp.mail.yahoo.com", _

smtpserverport:=465, _

sendusername:=senderAddress, _

sendpassword:=password)

Case Else

result = False

GoTo exitSection

End Select

End If ' cdoConfig is nothing

With cdomsg

Set .Configuration = cdoConfig

' mensaje

.from = senderAddress

.to = destinataryAddress

.subject = subject

.CC = CC

.BCC = BCC

.TextBody = body

.Send

End With

result = True

exitSection:

On Error GoTo 0

Set cdomsg = Nothing

sendEmail = result

Exit Function

errorSection:

result = False

MsgBox prompt:="Error " & Err.Number & ": " & Err.Description, _

Buttons:=vbCritical, _

Title:="sendEmail"

Resume exitSection

End Function Mi problema es donde incorporo esta instrucción: sendEmail senderAddress:="usuario@hotmail.com", _

destinataryAddress:="destinatario@destino.com", _

subject:="Hola desde VBA", _

body:="Mensaje enviado por medio de CDO desde una aplicación usando VBA", _

password:="clave_de_hotmail" espero me podáis ayudar. ANDRES

Featured Replies

No hay posts para mostrar

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.