Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I use this to piece of code to select from listbox2 the name of file
and send it vie email, but not work... In effect all file are stored in this path: OLDER_DOC = ("\\GCD01F4500\DATI\PUBBLICA\MODULI_GARANZIE\SERVI ZIO\" & dire & "\" & sotto & "\") Sub INVIO_MODULI() Dim FileArr As Variant Dim olApp As Object Dim olMsg As Object Dim F As Variant Dim FOLDER_DOC As String FOLDER_DOC = ("\\GCD01F4500\DATI\PUBBLICA\MODULI_GARANZIE\SERVI ZIO \" & dire & "\" & sotto & "\") Call SELEZIONE_MODULI(FileArr) If FileArr = Empty Then MsgBox "NESSUN FILE SELEZIONATO", vbCritical, "INVIO CANCELLATO" Exit Sub End If Set olApp = CreateObject("Outlook.Application") Set olMsg = olApp.CreateItem(0) With olMsg .Body = "TEST MESSAGGIO" .Subject = "TEST OGGETTO" For Each F In FileArr .Attachments.Add F Next F .Display End With Set olMsg = Nothing Set olApp = Nothing End Sub Sub SELEZIONE_MODULI(FileArr) Dim I As Integer FileArr = "" For I = 0 To UserForm3.ListBox2.ListCount - 1 If UserForm3.ListBox2.Selected(I) Then FileArr = UserForm3.ListBox2.List(I) End If Next I End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Please clarify:
1. What excel version and operating system are you using? 2. Where, specifically does the procedure fail? 3. What is the error message? On Oct 9, 6:21 am, sal21 wrote: I use this to piece of code to select from listbox2 the name of file and send it vie email, but not work... In effect all file are stored in this path: OLDER_DOC = ("\\GCD01F4500\DATI\PUBBLICA\MODULI_GARANZIE\SERVI ZIO\" & dire & "\" & sotto & "\") Sub INVIO_MODULI() Dim FileArr As Variant Dim olApp As Object Dim olMsg As Object Dim F As Variant Dim FOLDER_DOC As String FOLDER_DOC = ("\\GCD01F4500\DATI\PUBBLICA\MODULI_GARANZIE\SERVI ZIO \" & dire & "\" & sotto & "\") Call SELEZIONE_MODULI(FileArr) If FileArr = Empty Then MsgBox "NESSUN FILE SELEZIONATO", vbCritical, "INVIO CANCELLATO" Exit Sub End If Set olApp = CreateObject("Outlook.Application") Set olMsg = olApp.CreateItem(0) With olMsg .Body = "TEST MESSAGGIO" .Subject = "TEST OGGETTO" For Each F In FileArr .Attachments.Add F Next F .Display End With Set olMsg = Nothing Set olApp = Nothing End Sub Sub SELEZIONE_MODULI(FileArr) Dim I As Integer FileArr = "" For I = 0 To UserForm3.ListBox2.ListCount - 1 If UserForm3.ListBox2.Selected(I) Then FileArr = UserForm3.ListBox2.List(I) End If Next I End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
run marco to send a excel file by email(lotus note) | Excel Discussion (Misc queries) | |||
how to send file to email | Excel Discussion (Misc queries) | |||
Send file in an email | Excel Programming | |||
File...Send To...Email Recipient | Excel Programming | |||
Save a file and send as an email - written into macro | Excel Programming |