Condividi:        

mail da access 2007

Vuoi potenziare i tuoi documenti Word? Non sai come si fa una macro in Excel? Devi creare una presentazione in PowerPoint?
Oppure sei passato a OpenOffice e non sei sicuro di come lavorare al meglio?

Moderatori: Anthony47, Flash30005

mail da access 2007

Postdi Paolo87 » 06/02/09 10:33

Salve ragazzi,vi scrivo in merito ad un progettino che ho quasi finito per un data
base musicale fatto in Access 2007.Come faccio a spedire una mail che mi avverte che il db è stato aggiornato,senza usare outlook express ??? .
In giro ho trovato questo codice qui :
Codice: Seleziona tutto
Private Sub Comando0_Click()

Dim strInput As String
Dim Oggetto As String
Dim Messaggio As String

On Error GoTo Error_GetUserAddress

Oggetto = "oggetto di prova"
Messaggio = "messaggio di prova"

'Inizio costruzione della stringa di invio

strInput = "Mailto: email*xxxxxx.it"


' Fine costruzione della stringa di invio


Application.FollowHyperlink strInput, , True
GetUserAddress = True


Exit_GetUserAddress:
Exit Sub
Error_GetUserAddress:
MsgBox Err & ": " & Err.Description
GetUserAddress = False
Resume Exit_GetUserAddress
End Sub


ma ho notato che funziona solo se ho outlook e la cosa nn mi piace,anche perchè vorrei mettelro su un ftp personale e condividerlo con l'amico mio,quidni dovrebbe essere automatico,ma come posso fare ???
Paolo87
Utente Senior
 
Post: 305
Iscritto il: 26/08/07 09:54
Località: Roma

Sponsor
 

Re: mail da access 2007

Postdi archimede » 06/02/09 13:25

Prova qui.

HTH.

Alessandro
archimede
Moderatore
 
Post: 2851
Iscritto il: 07/11/02 12:41
Località: Genova

Re: mail da access 2007

Postdi Paolo87 » 06/02/09 15:19

wow codice molto valido. quindi io avendo uan tabella unica cn i seguenti campi : ID ( primary key),Artista,Canzone,Download il codice sarebbe :
Codice: Seleziona tutto
Public Sub SendMail()
'Provides the Send Mail automation
    Dim dbs As DAO.Database
    Dim rst As DAO.Recordset
    Dim strSubject As String
    Dim strEmailAddress As String
    Dim strEMailMsg As String
    Dim ingCounter As Integer
    Dim intCount As Integer

    strSubject = "Aggiornamento"
    strEmailAddress = "[Mail Addresses Go Here]"
    strEmailAddress="[altro indirizzo]"
    'strEmailAddress,replace [Mail Addresses Go Here] above with valid
    'e-mail addresses
    Set dbs = CurrentDb
    Set rst = dbs.OpenRecordset("qrySendMail") => io lo leverei tnt la mail sn sl 2


    'Count of unsent e-mails
    intCount = DCount("[ID]", "[Artista]" _
                                         , "[Download]=0")
    'If count of unsent e-mails is zero then the procedure will not run
    'If count of unsent e-mails is greater than zero, msgbox will prompt
    'to send mail.

    If intCount = 0 Then
        MsgBox ("You have " & intCount & " nuove canzoni.") _
               , vbInformation, "System Information"
        Exit Sub
    Else

        rst.MoveFirst
        Do Until rst.EOF

    strEMailMsg = rst![strID] & " " & rst![strArtista] _
       & " - " & rst![strCanzone] & " - " & " on the " & rst![strDownload] _
       & " course" & " has informed us of a new job."
       'EMAIL USER DETAILS & ATT REPORT
       DoCmd.SendObject , , acFormatRTF, strEmailAddress, _
                          , , strSubject, strEMailMsg, False, False


            rst.MoveNext
        Loop
        rst.Close
        Set rst = Nothing
        dbs.Close
        Set dbs = Nothing

        'Run update to update the sent mail check box
        DoCmd.SetWarnings False
        DoCmd.RunSQL "UPDATE Database " & _
                     "SET tblJobOutcomes.ysnSentByMailToStaff = -1 " & _   => queste 2 righe le posso omettere se so che
                     "WHERE (((tblJobOutcomes.ysnSentByMailToStaff)=0))" \\ devo mandare sl 2 mail
        DoCmd.SetWarnings True
        MsgBox "Mail inviata con successo", vbInformation, "Grazie"
    End If
End Sub


Aspetto la tua conferma Archimede
Paolo87
Utente Senior
 
Post: 305
Iscritto il: 26/08/07 09:54
Località: Roma

Re: mail da access 2007

Postdi archimede » 06/02/09 17:42

Purtroppo non ho qui un PC Windows per fare test: prova tu e se hai problemi specificali qui.

Alessandro
archimede
Moderatore
 
Post: 2851
Iscritto il: 07/11/02 12:41
Località: Genova


Torna a Applicazioni Office Windows


Topic correlati a "mail da access 2007":


Chi c’è in linea

Visitano il forum: Marius44 e 66 ospiti