Results 1 to 2 of 2
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: String balank, WHY! (2000 sr 1)

    The variable strEmailAddress is not assigned a value anywhere in this code, so unless you assign it a value elsewhere, it will be an empty string "".

    Perhaps you meant

    If Not MATRICOLA = "" Then
    strEmailAddress = MATRICOLA
    ElseIf Not MATRICOLA2 = "" Then
    strEmailAddress = MATRICOLA2
    Else
    MsgBox "Cannot assign e-mail address!", vbExclamation
    Exit Sub
    End If

  2. #2
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    String blank, WHY! (2000 sr 1)

    This is a part of code to send email but macro read blank string why!!!!!!!!

    When i pass with mouse on string "strEmailAddress" is = "" and not filled....
    i ahve dimenioned the string into a module global strEmailAddressis as tring and global MATRICOLA as string

    Dim objOutlook As Outlook.Application
    Set objOutlook = New Outlook.Application
    Dim objMailMsg As Outlook.MailItem
    Set objMailMsg = objOutlook.CreateItem(olMailItem)

    If Not Sheets("ISTANTANEA").Range("F" + RIGA) = "IN SERVIZIO UTENTE " And Not (Sheets("T3574").Range("AI" + RIGA2)) = "" And CheckBox1 = True Then
    MESSAGGIO = "ATTENZIONE : IL CASH " + Sheets("T3574").Range("AF" + RIGA2) + " NON E' IN SERVIZIO UTENTE - Verificare grazie."
    'Set myOlApp = CreateObject("Outlook.Application")
    'Set myItem = myOlApp.CreateItem(olMailItem)
    If Not MATRICOLA = "" And Not MATRICOLA2 = "" Then
    MATRICOLA = strEmailAddress '= MATRICOLA
    objMailMsg.To = strEmailAddress
    'objMailMsg.To = MATRICOLA2
    'myRecipient.Type = 2
    End If
    objMailMsg.Subject = ("BANCOMAT")
    objMailMsg.Body = MESSAGGIO
    objMailMsg.Send
    End If

    If Sheets("ISTANTANEA").Range("K" + RIGA) = "WARNING" And Not (Sheets("T3574").Range("AI" + RIGA2)) = "" And CheckBox2 = True Then
    MESSAGGIO = "ATTENZIONE : IL CASH " + Sheets("T3574").Range("AF" + RIGA2) + " PRESENTA IL DISPENSATORE DI BANCONOTE IN >> WARNING << - Se il messaggio di attenzione sulla periferica permane per i prossimi 3-4 giorni richiedere assistenza per verifica."
    'Set myOlApp = CreateObject("Outlook.Application")
    'Set myItem = myOlApp.CreateItem(olMailItem)
    If Not MATRICOLA = "" And Not MATRICOLA2 = "" Then
    MATRICOLA = strEmailAddress '= MATRICOLA
    objMailMsg.To = strEmailAddress
    'objMailMsg.To = MATRICOLA2
    'myRecipient.Type = 2
    End If
    objMailMsg.Subject = ("BANCOMAT")
    objMailMsg.Body = MESSAGGIO
    objMailMsg.Send
    End If

    If Sheets("ISTANTANEA").Range("P" + RIGA) < 3 And Not (Sheets("T3574").Range("AI" + RIGA2)) = "" And CheckBox3 = True Then
    MESSAGGIO = "ATTENZIONE : IL CASH " + Sheets("T3574").Range("AF" + RIGA2) + " HA UN' AUTONOMIA INFERIORE A 3 GIORNI - Provvedere in tempo utile al caricamento delle banconote."
    'Set myOlApp = CreateObject("Outlook.Application")
    'Set myItem = myOlApp.CreateItem(olMailItem)
    If Not MATRICOLA = "" And Not MATRICOLA2 = "" Then
    MATRICOLA = strEmailAddress '= MATRICOLA
    objMailMsg.To = strEmailAddress
    'objMailMsg.To = MATRICOLA2
    'myRecipient.Type = 2
    End If
    objMailMsg.Subject = ("BANCOMAT")
    objMailMsg.Body = MESSAGGIO
    objMailMsg.Send
    End If

    GoTo TUTTOOK


    ERRATAEXCHANGE:

    errSend:

    MsgBox Err.Number & " : " & Err.Description

    'MESSAGGIO = ("PER IL CASH : " + Sheets("T3574").Range("AF" + RIGA2) + " NON E' STATO POSSIBILE INVIARE IL MESSAGGIO")
    'msgbox (MESSAGGIO)

    'Resume Next

    TUTTOOK:

    '=====INVIO EXCHANGE=====

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •