Notifications
Clear all

Loop de envio de Emails.

58 Posts
2 Usuários
0 Reactions
4,833 Visualizações
(@fazerbem)
Posts: 0
New Member
Topic starter
 

Bom dia, tenho uma macro que envia corretamente emails em bloco de 99 emails. Porem o Gmail identifica isso como Span. Porem nao é pois envio as Lojas as quais mantenho contato.
EM algum lugar eu vi que para isso nao ocorrer eu nao poderia enviar nem por C/C e nem por CCo. Porem eu gostaria de enviar por CCo e isso causa o retorno de erro.

Entao acho ser a unica forma de fazer os envios seria um a um mesmo, mas para isso eu precisaria de uma Macro que funcionasse por LOOP, assim sendo poderia individualizar no assunto.

Como a Macro abaixo funciona corretamente em certo grupo de envio em uma de minhas contas de envio e nao funciona em outra conta Gmail.

eu queria entao desta forma adaptar na macro em questao, uma cadeia de comandos com este objetivo. Funcionaria assim:

Se a Celula Q22 estiver com o numeral ( 1 ) , entao a regra de envio sera a de loop enviando email por email em separado. Se a Celula Q22 estiver vazia, entao seguira normalmente a Macro em questao abaixo. Poderiamos para isso usar o GOTO e iniciar a Macro no final desta abaixo.

A pasta que estao os emails se chama ( EN ), e o o primeiro Email se inicia na :

celula G2 e o ultimo esta na Celula G99 Depois tem outra sequencia na
Celula I2 e o ultimo esta na Celula I99 depois tem outra sequencia na
Celula K2 e o ultimo esta na celula K99 .........
Celula M2 ......
Celula O2 .......
Celula Q2 ....
e assim vai ate a celula AG2 ate AG 99

Agradeço a todos que mais uma vez puderem me dar uma ajudinha.

André

Sub X_Lojas_Convites()

'  Enviar Convites Lojas

If Range("E11") = "" Then
Run "Copiar1"
GoTo Segue

Else

If Range("F11") = "" Then
Run "Copiar2"
Else

If Range("G11") = "" Then
Run "Copiar3"
Else

If Range("H11") = "" Then
Run "Copiar4"
Else

If Range("I11") = "" Then
Run "Copiar5"
Else

If Range("E12") = "" Then
Run "Copiar6"
Else

If Range("F12") = "" Then
Run "Copiar7"
Else

If Range("G12") = "" Then
Run "Copiar8"
Else

If Range("H12") = "" Then
Run "Copiar9"
Else

If Range("I12") = "" Then
Run "Copiar10"
Else

If Range("E13") = "" Then
Run "Copiar11"
Else

If Range("F13") = "" Then
Run "Copiar12"
Else

If Range("G13") = "" Then
Run "Copiar13"
Else

If Range("H13") = "" Then
Run "Copiar14"

 Else
   Run "Copiar1"

End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If


GoTo Segue
Segue:

'If Worksheets("EN").Range("C1").Value = "" Then
'MsgBox ("Não foi copiado os E-mails para serem enviados !")
'Sheets("EN").Visible = True
'' GoTo Fim
  '       Else
   '           End If

'Setting up the Excel variables.
    Dim OlApp As Outlook.Application
    Dim OlMensagem As Outlook.MailItem
    Dim iCounter    As Integer
    Dim Dest        As Variant
    Dim SDest       As String
    Dim Estado      As String
    Dim BuscaEstado As Range
    Dim AbrevEstado As String
    Dim Leitura     As String
    Dim contaEmail As String
    Dim idEmail As Integer
    Dim strbody As String
    Dim Loja        As String
    Loja = Range("A1")
    
    If Range("K4") = 1 Then
    
strbody = "<H2>" & _
        Sheets("Enviar Convites").Range("V2").Value & _
        "</H2>" & _
        "<H3 style='color: #870c0c'>" & _
        Sheets("Enviar Convites").Range("V6").Value & _
        "</H3>" & _
        "<H3>" & _
        Sheets("Enviar Convites").Range("V10").Value & _
        "<br><br>" & _
        Sheets("Enviar Convites").Range("V14").Value & _
        "<br><br>" & _
        Sheets("Enviar Convites").Range("Z18").Value & _
        "<br><br>" & _
        Sheets("Enviar Convites").Range("Z22").Value & _
        "<br><br>" & _
        "<br><br><B>Obrigado por ser nosso parceiro, conte comigo!!</B>" & _
        "<br><br>"
    
GoTo Saltar
    
    Else
    End If

strbody = "<H2>" & _
        Sheets("Enviar Convites").Range("Z2").Value & _
        "</H2>" & _
        "<H3 style='color: #870c0c'>" & _
        Sheets("Enviar Convites").Range("Z6").Value & _
        "</H3>" & _
        "<H3>" & _
        Sheets("Enviar Convites").Range("Z10").Value & _
        "<br><br>" & _
        Sheets("Enviar Convites").Range("Z14").Value & _
        "<br><br>" & _
        Sheets("Enviar Convites").Range("Z18").Value & _
        "<br><br>" & _
        Sheets("Enviar Convites").Range("Z22").Value & _
        "<br><br>" & _
        Sheets("Enviar Convites").Range("Z23").Value & _
        "<br><br>" & _
        Sheets("Enviar Convites").Range("Z24").Value & _
        "<br><br>" & _
        Sheets("Enviar Convites").Range("Z25").Value & _
        "<br><br>" & _
        Sheets("Enviar Convites").Range("Z26").Value & _
        "</H3>" & _
        "<br><br><B>Obrigado por ser nosso parceiro, conte comigo!!</B>" & _
        "<br><br>"

GoTo Saltar
Saltar:

    Leitura = Sheets(Loja).Range("I7")
    Estado = Application.Caller
    Application.ScreenUpdating = False
    Sheets(Estado).Visible = True

 Application.DisplayAlerts = False 'desabilite o alerta

        Range("L2").Select



    Set BuscaEstado = ThisWorkbook.ActiveSheet.Range("A3:A8").Find(Estado, LookIn:=xlValues, LookAt:=xlWhole)
    
    If BuscaEstado Is Nothing Then
        MsgBox "Estado não localizado"
        GoTo Fim
    Else
    
        AbrevEstado = ThisWorkbook.Worksheets(Loja).Cells(BuscaEstado.Row, 1).Value
    End If
    
' Preste atencao aqui
      contaEmail = ThisWorkbook.Sheets(Loja).Range("I8").Value
    
    'Quero que aqui, ao inves de ter RJ tenha a variavel Estado que vai estar associado ao click na     regiao do mapa.
    ThisWorkbook.Worksheets(AbrevEstado).Select
   
    iCounter = 2 'inicia na linha 2
   
    'Create the Outlook application and the empty email.
    Set OlApp = CreateObject("Outlook.Application")
Set OlMensagem = OlApp.CreateItem(0)

'------------------------------------------------------------------------------
   
   'Este laço verifica se o nome da conta w no registro do windows é igual ao valor da célula
    For w = 1 To OlApp.Session.Accounts.Count
        If OlApp.Session.Accounts.Item(w).DisplayName = contaEmail Then 'Se for verdadeiro, solicita confirmação
            If MsgBox("O E-mail será enviado usando a conta " & contaEmail & ". Confirma ?" & "    ( Estado - " & Estado & " )", vbQuestion + vbYesNo, "Envio de e-mail") = vbYes Then
                            
                idEmail = w 'Define o id da conta para o comando enviar
                Exit For 'Sai do laço
                
            Else
                 Sheets(Estado).Visible = False
                 Sheets(Loja).Select
                
                GoTo Fim 'Senão sai da rotina
            End If
        End If
    Next
'-------------------------------------------------------------------------------
'Using the email, add multiple recipients, using a list of addresses in column C.
     With OlMensagem
       For iCounter = 2 To WorksheetFunction.CountA(Columns(3))  ' Linha 2 da coluna 3
       
       ' Sheets("Email").Select
               SDest = SDest & ";" & Cells(iCounter, 3).Value
       Next iCounter
          
'     Sheets("parar").Select
     
          
    'Do additional formatting on the BCC and Subject lines, add the body text from the spreadsheet, and send.
       .Display
       
If Sheets("Enviar Convites").Range("Q15").Value = 1 Then
       
       .BCC = SDest
       
Else
       
       .To = SDest
       
 End If
 
If Sheets("Enviar Convites").Range("K4").Value = 1 Then
  
       .Subject = "Tabela de Pedidos da Gauer do Brasil"
       
Else

       .Subject = "Tabela de Pedidos da Leader Nutrition"
       
End If
       
       .HTMLBody = strbody & "<br>" & .HTMLBody
       
If Sheets(Loja).Range("F1").Value > 0 Then
       .Attachments.Add "C:UsersAndreDesktopPedidos Gauer" & Sheets(Loja).Range("F1").Value & Sheets(Loja).Range("I1").Value
Else
    End If

If Sheets(Loja).Range("F2").Value > 0 Then
       .Attachments.Add "C:UsersAndreDesktopPedidos Gauer" & Sheets(Loja).Range("F2").Value & Sheets(Loja).Range("I2").Value
Else
    End If
If Sheets(Loja).Range("F3").Value > 0 Then
       .Attachments.Add "C:UsersAndreDesktopPedidos Gauer" & Sheets(Loja).Range("F3").Value & Sheets(Loja).Range("I3").Value
Else
    End If
If Sheets(Loja).Range("F4").Value > 0 Then
       .Attachments.Add "C:UsersAndreDesktopPedidos Gauer" & Sheets(Loja).Range("F4").Value & Sheets(Loja).Range("I3").Value
Else
    End If
       
       
If Sheets(Loja).Range("I6").Value = "SEND" Then
       .ReadReceiptRequested = Leitura ' confirmação de leitura
       .SendUsingAccount = OlApp.Session.Accounts.Item(idEmail)
       .Send
Else

       .ReadReceiptRequested = Leitura ' confirmação de leitura
       .SendUsingAccount = OlApp.Session.Accounts.Item(idEmail)
       .Display
        
End If

Sheets("EN").Select
' Limpar Email Planilha EN ( Enviar Convites )
    Sheets("EN").Range("C1:C99").Select
    Selection.ClearContents
    Range("D1").Select

Sheets(Loja).Select
If Range("K12").Value = 105 Then
    Range("E11:I13").Select
    Selection.ClearContents
    
Else
End If

Sheets(Estado).Visible = False
   
GoTo Fim

   End With

    Exit Sub
Fim:
   'Clean up the Outlook application.
   Set BuscaEstado = Nothing
   Set OlMensagem = Nothing
   Set OlApp = Nothing
   
End Sub
 
Postado : 15/04/2016 7:54 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Puts, que vacilo.
O i no final troca por lin

 
Postado : 15/04/2016 3:04 pm
(@fazerbem)
Posts: 0
New Member
Topic starter
 

outra coisa eu nao entendi uma coisa

eu quero que o envio de email individual aconteca somente se a Celula Q22 estiver = 1, caso contrario ignorar e enviar em bloco como antes, é assim que esta ?

Pois no codigo nao vi descriminado o IF apontando para Q22.

 
Postado : 15/04/2016 3:05 pm
(@fazerbem)
Posts: 0
New Member
Topic starter
 

Puts, que vacilo.
O i no final troca por lin

mas ele trava no for aqui

For col = 7 To 33

 
Postado : 15/04/2016 3:08 pm
(@fazerbem)
Posts: 0
New Member
Topic starter
 

vc esqueceu de criar as Dim

Dim col As Long
Dim Lin As Long

mas agora esta parando aqui olha

If wsEN.Cells(Lin, col).Value = Empty Then Next i,

trava no NEXT

erro de compilacao Next sem FOR

 
Postado : 15/04/2016 3:16 pm
(@fazerbem)
Posts: 0
New Member
Topic starter
 

reparei tambem que se eu excluir esse Nest acima e continuar a rodar a macro o outro Next la em baixo trava tambem em cima dele., ou seja o Next Lin, acredito que o proximo a trvar sera o Next Col

Next Lin
Next col

Exit Sub
Fim:
'Clean up the Outlook application.

 
Postado : 15/04/2016 3:23 pm
(@fazerbem)
Posts: 0
New Member
Topic starter
 

existem problemas tb de IF sem End If

 
Postado : 15/04/2016 3:25 pm
(@fazerbem)
Posts: 0
New Member
Topic starter
 

Veja que acrescentei:

Dim col As Long
Dim Lin As Long
coloquei endereco :

Caminho = "C:UsersAndreDesktopPedidos Gaueramigo lojista.jpg"

Aqui :

For col = 7 To 33
For Lin = 2 To 99
If wsEN.Cells(Lin, col).Value = Empty Then ' Next i mudei para nao contar com este Next

e pus os 2 next mais abaixo e acrescentei um End If

End If
Next Lin
Next col

Sub End

Fiz as devidas correcoes e ficou assim conforme abaixo mais agora esta travando em:

.Attachments.Add Caminho & wsLoja.Range("F" & i).Value & wsLoja.Range("I" & i).Value

Option Explicit

Sub Xxx_Lojas_Convites()
'Setting up the Excel variables.
Dim OlApp           As Outlook.Application
Dim OlMensagem      As Outlook.MailItem
Dim wb              As Workbook
Dim wsEN            As Worksheet
Dim wsLoja          As Worksheet
Dim wsEstado        As Worksheet
Dim wsSendConvite   As Worksheet
Dim iCounter        As Integer
Dim Dest            As Variant
Dim SDest           As String
Dim Estado          As String
Dim BuscaEstado     As Range
Dim AbrevEstado     As String
Dim Leitura         As String
Dim contaEmail      As String
Dim idEmail         As Integer
Dim strbody         As String
Dim Loja            As String
Dim Caminho         As String
Dim Quebralin1      As String
Dim QuebraLin2      As String
Dim ContCopy        As Long
Dim i               As Long
Dim j               As Long
Dim w               As Long
Dim col             As Long
Dim Lin             As Long


    Set wb = ThisWorkbook
    Set wsEN = wb.Worksheets("EN")
    Set wsSendConvite = wb.Worksheets("Enviar Convites")
    Quebralin1 = "<br>"
    QuebraLin2 = "<br><br>"
    Caminho = "C:UsersAndreDesktopPedidos Gaueramigo lojista.jpg"

    '  Enviar Convites Lojas
    For i = 11 To 13
        For j = 5 To 9
            ContCopy = ContCopy + 1
            If wb.ActiveSheet.Cells(i, j).Value = "" Then
                Run "Copiar" & ContCopy
                GoTo Segue
            End If
        Next j
    Next i
    
    Run "Copiar1"
    
Segue:

    Loja = wb.ActiveSheet.Range("A1").Value
    Set wsLoja = wb.Worksheets(Loja)
    
    If wb.ActiveSheet.Range("K4").Value = 1 Then
        strbody = "<H2>" & _
                    wsSendConvite.Range("V2").Value & _
                "</H2>" & _
                "<H3 style='color: #870c0c'>" & _
                    wsSendConvite.Range("V6").Value & _
                "</H3>" & _
                "<H3>" & _
                    wsSendConvite.Range("V10").Value & QuebraLin2 & _
                    wsSendConvite.Range("V14").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z18").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z22").Value & _
                "</H3>" & _
                QuebraLin2 & "<B>Obrigado por ser nosso parceiro, conte comigo!!</B>" & QuebraLin2
    Else
        strbody = "<H2>" & _
                    wsSendConvite.Range("Z2").Value & _
                "</H2>" & _
                "<H3 style='color: #870c0c'>" & _
                    wsSendConvite.Range("Z6").Value & _
                "</H3>" & _
                "<H3>" & _
                    wsSendConvite.Range("Z10").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z14").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z18").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z22").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z23").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z24").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z25").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z26").Value & _
                "</H3>" & _
                QuebraLin2 & "<B>Obrigado por ser nosso parceiro, conte comigo!!</B>" & QuebraLin2
    End If

Saltar:

    Leitura = wsLoja.Range("I7").Value
    Estado = Application.Caller
    Application.ScreenUpdating = False
    Set wsEstado = wb.Worksheets(Estado)
    wsEstado.Visible = True

    Application.DisplayAlerts = False   'desabilite o alerta

    wb.ActiveSheet.Range("L2").Select

    Set BuscaEstado = wb.ActiveSheet.Range("A3:A8").Find(Estado, LookIn:=xlValues, LookAt:=xlWhole)
    
    If BuscaEstado Is Nothing Then
        MsgBox "Estado não localizado"
        GoTo Fim
    Else
        AbrevEstado = wsLoja.Cells(BuscaEstado.Row, 1).Value
    End If
    
    ' Preste atencao aqui
      contaEmail = wsLoja.Range("I8").Value
    
    'Quero que aqui, ao inves de ter RJ tenha a variavel Estado que vai estar associado ao click na     regiao do mapa.
    wb.Worksheets(AbrevEstado).Select
   
    iCounter = 2 'inicia na linha 2
   
    'Create the Outlook application and the empty email.
    Set OlApp = CreateObject("Outlook.Application")


    For col = 7 To 33
        For Lin = 2 To 99
            If wsEN.Cells(Lin, col).Value = Empty Then  'Next i
         
            Set OlMensagem = OlApp.CreateItem(0)
        
        '------------------------------------------------------------------------------
           'Este laço verifica se o nome da conta w no registro do windows é igual ao valor da célula
            For w = 1 To OlApp.Session.Accounts.Count
                If OlApp.Session.Accounts.Item(w).DisplayName = contaEmail Then 'Se for verdadeiro, solicita confirmação
                    If MsgBox("O E-mail será enviado usando a conta " & contaEmail & ". Confirma ?" & "    ( Estado - " & Estado & " )", vbQuestion + vbYesNo, "Envio de e-mail") = vbYes Then
                        idEmail = w 'Define o id da conta para o comando enviar
                        Exit For 'Sai do laço
                    Else
                         wsEstado.Visible = False
                         wsLoja.Select
                        GoTo Fim 'Senão sai da rotina
                    End If
                End If
            Next
        '-------------------------------------------------------------------------------
        
        'Using the email, add multiple recipients, using a list of addresses in column C.
            With OlMensagem
            
                .Display
                   
                If wsSendConvite.Range("Q15").Value = 1 Then
                    .BCC = wsEN.Cells(Lin, col).Value
                Else
                    .To = wsEN.Cells(Lin, col).Value
                End If
            
                If wsSendConvite.Range("K4").Value = 1 Then
                    .Subject = "Tabela de Pedidos da Gauer do Brasil"
                Else
                    .Subject = "Tabela de Pedidos da Leader Nutrition"
                End If
                   
                .HTMLBody = strbody & Quebralin1 & .HTMLBody
                
                For i = 1 To 4
                    If wsLoja.Range("F" & i).Value > 0 Then
                        .Attachments.Add Caminho & wsLoja.Range("F" & i).Value & wsLoja.Range("I" & i).Value
                    End If
                Next i
                
                .ReadReceiptRequested = Leitura ' confirmação de leitura
                .SendUsingAccount = OlApp.Session.Accounts.Item(idEmail)
                
                If wsLoja.Range("I6").Value = "SEND" Then
                    .Send
                Else
                    .Display
                End If
            
                wsEN.Select
                ' Limpar Email Planilha EN ( Enviar Convites )
                wsEN.Range("C1:C99").ClearContents
                wsEN.Range("D1").Select
            
                wsLoja.Select
                If wsLoja.Range("K12").Value = 105 Then
                    wsLoja.Range("E11:I13").ClearContents
                End If
            
                Sheets(Estado).Visible = False
               
                GoTo Fim
        
            End With
    
  '     Next Lin
  '  Next col

    Exit Sub
Fim:
   'Clean up the Outlook application.
    Set BuscaEstado = Nothing
    Set OlMensagem = Nothing
    Set OlApp = Nothing
    Set wb = Nothing
    Set wsEN = Nothing
    Set wsSendConvite = Nothing
    Set wsLoja = Nothing
    Set wsEstado = Nothing
   
End If
Next Lin
Next col

   
End Sub
 
Postado : 15/04/2016 3:41 pm
(@fazerbem)
Posts: 0
New Member
Topic starter
 

Bem amigo, pesquisando aqui na Net, eu encontrei isso aqui, testei separadamente e abriu conforme exatamente eu quero, porem nao sei como adaptar na Macro que o amigo fez a arrumacao, portanto poderia unir a macro de assinatura no codigo mais abaixo ?

Outra coisa, conforme ja relatei, a alteracao por vc fornecidas na sua ultima postagem deu erros, portanto voltei a anterior e troquei o 8 por 9 , conforme tb ja mencionado, e deu certo, so falta agora incluir a assinatura e o envio de email individual conforme Q22 =1 ou ""

Option Explicit
Dim assinatura As Variant

Public Function pega_assinatura(ByVal sFile As String) As String
'Dick Kusleika
Dim fso As Object
Dim ts As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
pega_assinatura = ts.ReadAll
ts.Close
End Function

Sub Cria_mensagem_HTML()
'Creates a new e-mail item and modifies its properties.

Dim olapp As Outlook.Application
Dim objMail As MailItem
Set olapp = Outlook.Application
'Create mail item
Set objMail = olapp.CreateItem(olMailItem)

' assinatura = pega_assinatura("C:Documents and Settings" & _
' Environ("username") & "AppDataRoamingMicrosoftAssinaturasPaulo.htm")

assinatura = pega_assinatura("C:AssinaturasAmigo Lojista.Html") ' & _
' Environ("username") & "Amigo Lojista.html")

With objMail
'Set body format to HTML
'a tag
'quebra linha
'a tag formata o texto para negrito
.BodyFormat = olFormatHTML
.HTMLBody = "Texto " & assinatura
.Display
End With

End Sub

Option Explicit

Sub XA_Lojas_Convites()

'Setting up the Excel variables.
Dim olapp           As Outlook.Application
Dim OlMensagem      As Outlook.MailItem
Dim wb              As Workbook
Dim wsEN            As Worksheet
Dim wsLoja          As Worksheet
Dim wsEstado        As Worksheet
Dim wsSendConvite   As Worksheet
Dim iCounter        As Integer
Dim Dest            As Variant
Dim SDest           As String
Dim Estado          As String
Dim BuscaEstado     As Range
Dim AbrevEstado     As String
Dim Leitura         As String
Dim contaEmail      As String
Dim idEmail         As Integer
Dim strbody         As String
Dim Loja            As String
Dim Caminho         As String
Dim Quebralin1      As String
Dim QuebraLin2      As String
Dim ContCopy        As Long
Dim i               As Long
Dim j               As Long
Dim w               As Long

    Set wb = ThisWorkbook
    Set wsEN = wb.Worksheets("EN")
    Set wsSendConvite = wb.Worksheets("Enviar Convites")
    Quebralin1 = "<br>"
    QuebraLin2 = "<br><br>"
    Caminho = "C:UsersAndreDesktopPedidos Gauer"

    '  Enviar Convites Lojas
    For i = 11 To 13
        For j = 5 To 9
            ContCopy = ContCopy + 1
            If wb.ActiveSheet.Cells(i, j).Value = "" Then
                Run "Copiar" & ContCopy
                GoTo Segue
            End If
        Next j
    Next i
    
    Run "Copiar1"
    
Segue:

    Loja = wb.ActiveSheet.Range("A1").Value
    Set wsLoja = wb.Worksheets(Loja)
    
    If wb.ActiveSheet.Range("K4").Value = 1 Then
        strbody = "<H2>" & _
                    wsSendConvite.Range("V2").Value & _
                "</H2>" & _
                "<H3 style='color: #870c0c'>" & _
                    wsSendConvite.Range("V6").Value & _
                "</H3>" & _
                "<H3>" & _
                    wsSendConvite.Range("V10").Value & QuebraLin2 & _
                    wsSendConvite.Range("V14").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z18").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z22").Value & _
                "</H3>" & _
                QuebraLin2 & "<B>Obrigado por ser nosso parceiro, conte comigo!!</B>" & QuebraLin2
    Else
        strbody = "<H2>" & _
                    wsSendConvite.Range("Z2").Value & _
                "</H2>" & _
                "<H3 style='color: #870c0c'>" & _
                    wsSendConvite.Range("Z6").Value & _
                "</H3>" & _
                "<H3>" & _
                    wsSendConvite.Range("Z10").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z14").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z18").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z22").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z23").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z24").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z25").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z26").Value & _
                "</H3>" & _
                QuebraLin2 & "<B>Obrigado por ser nosso parceiro, conte comigo!!</B>" & QuebraLin2
    End If

Saltar:

    Leitura = wsLoja.Range("I7").Value
    Estado = Application.Caller
    Application.ScreenUpdating = False
    Set wsEstado = wb.Worksheets(Estado)
    wsEstado.Visible = True

    Application.DisplayAlerts = False   'desabilite o alerta

    wb.ActiveSheet.Range("L2").Select

    Set BuscaEstado = wb.ActiveSheet.Range("A3:A8").Find(Estado, LookIn:=xlValues, LookAt:=xlWhole)
    
    If BuscaEstado Is Nothing Then
        MsgBox "Estado não localizado"
        GoTo Fim
    Else
        AbrevEstado = wsLoja.Cells(BuscaEstado.Row, 1).Value
    End If
    
    ' Preste atencao aqui
      contaEmail = wsLoja.Range("I8").Value
    
    'Quero que aqui, ao inves de ter RJ tenha a variavel Estado que vai estar associado ao click na     regiao do mapa.
    wb.Worksheets(AbrevEstado).Select
   
    iCounter = 2 'inicia na linha 2
   
    'Create the Outlook application and the empty email.
    Set olapp = CreateObject("Outlook.Application")
    Set OlMensagem = olapp.CreateItem(0)

'------------------------------------------------------------------------------
   
   'Este laço verifica se o nome da conta w no registro do windows é igual ao valor da célula
    For w = 1 To olapp.Session.Accounts.Count
        If olapp.Session.Accounts.Item(w).DisplayName = contaEmail Then 'Se for verdadeiro, solicita confirmação
            If MsgBox("O E-mail será enviado usando a conta " & contaEmail & ". Confirma ?" & "    ( Estado - " & Estado & " )", vbQuestion + vbYesNo, "Envio de e-mail") = vbYes Then
                idEmail = w 'Define o id da conta para o comando enviar
                Exit For 'Sai do laço
            Else
                 wsEstado.Visible = False
                 wsLoja.Select
                GoTo Fim 'Senão sai da rotina
            End If
        End If
    Next
'-------------------------------------------------------------------------------
'Using the email, add multiple recipients, using a list of addresses in column C.
    With OlMensagem
        For iCounter = 2 To WorksheetFunction.CountA(Columns(3))  ' Linha 2 da coluna 3
        
         'Sheets("Email").Select
                SDest = SDest & ";" & Cells(iCounter, 3).Value
        Next iCounter
          
    '     Sheets("parar").Select
         
              
        'Do additional formatting on the BCC and Subject lines, add the body text from the spreadsheet, and send.
           .Display
           
        If wsSendConvite.Range("Q15").Value = 1 Then
            .BCC = SDest
        Else
            .To = SDest
        End If
    
        If wsSendConvite.Range("K4").Value = 1 Then
            .Subject = "Tabela de Pedidos da Gauer do Brasil"
        Else
            .Subject = "Tabela de Pedidos da Leader Nutrition"
        End If
           
        .HTMLBody = strbody & Quebralin1 & .HTMLBody
           
        For i = 1 To 4
            If wsLoja.Range("F" & i).Value > 0 Then
                .Attachments.Add Caminho & wsLoja.Range("F" & i).Value & wsLoja.Range("I" & i).Value
            End If
        Next i
        
        
        .ReadReceiptRequested = Leitura ' confirmação de leitura
        .SendUsingAccount = olapp.Session.Accounts.Item(idEmail)
        
        If wsLoja.Range("I6").Value = "SEND" Then
            .Send
        Else
            .Display
        End If
    
        wsEN.Select
        ' Limpar Email Planilha EN ( Enviar Convites )
        wsEN.Range("C1:C99").ClearContents
        wsEN.Range("D1").Select
    
        wsLoja.Select
        If wsLoja.Range("K12").Value = 105 Then
            wsLoja.Range("E11:I13").ClearContents
        End If
    
        Sheets(Estado).Visible = False
       
        GoTo Fim

    End With

    Exit Sub
Fim:
   'Clean up the Outlook application.
    Set BuscaEstado = Nothing
    Set OlMensagem = Nothing
    Set olapp = Nothing
    Set wb = Nothing
    Set wsEN = Nothing
    Set wsSendConvite = Nothing
    Set wsLoja = Nothing
    Set wsEstado = Nothing
   
End Sub
 
Postado : 16/04/2016 2:22 pm
(@fazerbem)
Posts: 0
New Member
Topic starter
 

Bernardo, consegui resolver o problema das assinaturas, segue abaixo o codigo.

Grato

Option Explicit
Dim assinatura As Variant
Public Function pega_assinatura(ByVal sFile As String) As String
'Dick Kusleika
    Dim fso As Object
    Dim ts As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
    pega_assinatura = ts.ReadAll
    ts.Close
End Function

Sub XA_Lojas_Convites()

'Setting up the Excel variables.
Dim olapp           As Outlook.Application
Dim OlMensagem      As Outlook.MailItem
Dim wb              As Workbook
Dim wsEN            As Worksheet
Dim wsLoja          As Worksheet
Dim wsEstado        As Worksheet
Dim wsSendConvite   As Worksheet
Dim iCounter        As Integer
Dim Dest            As Variant
Dim SDest           As String
Dim Estado          As String
Dim BuscaEstado     As Range
Dim AbrevEstado     As String
Dim Leitura         As String
Dim contaEmail      As String
Dim idEmail         As Integer
Dim strbody         As String
Dim Loja            As String
Dim Caminho         As String
Dim Quebralin1      As String
Dim QuebraLin2      As String
Dim ContCopy        As Long
Dim i               As Long
Dim j               As Long
Dim w               As Long
'--------------------------------------------------------
    Dim objMail As MailItem
    Set olapp = Outlook.Application
    'Create mail item
    Set objMail = olapp.CreateItem(olMailItem)
'------------------------------------------------------------
    
If Range("I8").Value = "Amigo Lojista" Or Range("I8").Value = "Vendas Energy" Then
  
      assinatura = pega_assinatura("C:AssinaturasAmigo.htm")
      
 Else
      
If Range("I8").Value = "Gauer do Brasil - André" Or Range("I8").Value = "Vendas Gauer" Then
  
      assinatura = pega_assinatura("C:AssinaturasGauer.htm")
  
Else

      assinatura = pega_assinatura("C:AssinaturasLeader.htm")

End If
End If

'-----------------------------------------------------------


    Set wb = ThisWorkbook
    Set wsEN = wb.Worksheets("EN")
    Set wsSendConvite = wb.Worksheets("Enviar Convites")
    Quebralin1 = "<br>"
    QuebraLin2 = "<br><br>"
    Caminho = "C:UsersAndreDesktopPedidos Gauer"

    '  Enviar Convites Lojas
    For i = 11 To 13
        For j = 5 To 9
            ContCopy = ContCopy + 1
            If wb.ActiveSheet.Cells(i, j).Value = "" Then
                Run "Copiar" & ContCopy
                GoTo Segue
            End If
        Next j
    Next i
    
    Run "Copiar1"
    
Segue:

    Loja = wb.ActiveSheet.Range("A1").Value
    Set wsLoja = wb.Worksheets(Loja)
    
    If wb.ActiveSheet.Range("K4").Value = 1 Then
        strbody = "<H2>" & _
                    wsSendConvite.Range("V2").Value & _
                "</H2>" & _
                "<H3 style='color: #870c0c'>" & _
                    wsSendConvite.Range("V6").Value & _
                "</H3>" & _
                "<H3>" & _
                    wsSendConvite.Range("V10").Value & QuebraLin2 & _
                    wsSendConvite.Range("V14").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z18").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z22").Value & _
                "</H3>" & _
                QuebraLin2 & "<B>Obrigado por ser nosso parceiro, conte comigo!!</B>" & QuebraLin2
    Else
        strbody = "<H2>" & _
                    wsSendConvite.Range("Z2").Value & _
                "</H2>" & _
                "<H3 style='color: #870c0c'>" & _
                    wsSendConvite.Range("Z6").Value & _
                "</H3>" & _
                "<H3>" & _
                    wsSendConvite.Range("Z10").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z14").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z18").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z22").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z23").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z24").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z25").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z26").Value & _
                "</H3>" & _
                QuebraLin2 & "<B>Obrigado por ser nosso parceiro, conte comigo!!</B>" & QuebraLin2
    End If

Saltar:

    Leitura = wsLoja.Range("I7").Value
    Estado = Application.Caller
    Application.ScreenUpdating = False
    Set wsEstado = wb.Worksheets(Estado)
    wsEstado.Visible = True

    Application.DisplayAlerts = False   'desabilite o alerta

    wb.ActiveSheet.Range("L2").Select

    Set BuscaEstado = wb.ActiveSheet.Range("A3:A8").Find(Estado, LookIn:=xlValues, LookAt:=xlWhole)
    
    If BuscaEstado Is Nothing Then
        MsgBox "Estado não localizado"
        GoTo Fim
    Else
        AbrevEstado = wsLoja.Cells(BuscaEstado.Row, 1).Value
    End If
    
    ' Preste atencao aqui
      contaEmail = wsLoja.Range("I8").Value
    
    'Quero que aqui, ao inves de ter RJ tenha a variavel Estado que vai estar associado ao click na     regiao do mapa.
    wb.Worksheets(AbrevEstado).Select
   
    iCounter = 2 'inicia na linha 2
   
    'Create the Outlook application and the empty email.
    Set olapp = CreateObject("Outlook.Application")
    Set OlMensagem = olapp.CreateItem(0)

'------------------------------------------------------------------------------
   
   'Este laço verifica se o nome da conta w no registro do windows é igual ao valor da célula
    For w = 1 To olapp.Session.Accounts.Count
        If olapp.Session.Accounts.Item(w).DisplayName = contaEmail Then 'Se for verdadeiro, solicita confirmação
            If MsgBox("O E-mail será enviado usando a conta " & contaEmail & ". Confirma ?" & "    ( Estado - " & Estado & " )", vbQuestion + vbYesNo, "Envio de e-mail") = vbYes Then
                idEmail = w 'Define o id da conta para o comando enviar
                Exit For 'Sai do laço
            Else
                 wsEstado.Visible = False
                 wsLoja.Select
                GoTo Fim 'Senão sai da rotina
            End If
        End If
    Next
'-------------------------------------------------------------------------------
'Using the email, add multiple recipients, using a list of addresses in column C.
    With OlMensagem
        For iCounter = 2 To WorksheetFunction.CountA(Columns(3))  ' Linha 2 da coluna 3
        
         'Sheets("Email").Select
                SDest = SDest & ";" & Cells(iCounter, 3).Value
        Next iCounter
          
    '     Sheets("parar").Select
         
              
        'Do additional formatting on the BCC and Subject lines, add the body text from the spreadsheet, and send.
           .Display
           
        If wsSendConvite.Range("Q15").Value = 1 Then
            .BCC = SDest
        Else
            .To = SDest
        End If
    
        If wsSendConvite.Range("K4").Value = 1 Then
            .Subject = "Tabela de Pedidos da Gauer do Brasil"
        Else
            .Subject = "Tabela de Pedidos da Leader Nutrition"
        End If
'------------------------------------------------------------------
        .BodyFormat = olFormatHTML
        .HTMLBody = strbody & Quebralin1 & assinatura & .HTMLBody
           
        For i = 1 To 4
            If wsLoja.Range("F" & i).Value > 0 Then
                .Attachments.Add Caminho & wsLoja.Range("F" & i).Value & wsLoja.Range("I" & i).Value
            End If
        Next i
        
        
        .ReadReceiptRequested = Leitura ' confirmação de leitura
        .SendUsingAccount = olapp.Session.Accounts.Item(idEmail)
        
        If wsLoja.Range("I6").Value = "SEND" Then
            .Send
        Else
 '-----------------------------------------
 
        
        
            .Display
        End If
    
        wsEN.Select
        ' Limpar Email Planilha EN ( Enviar Convites )
        wsEN.Range("C1:C99").ClearContents
        wsEN.Range("D1").Select
    
        wsLoja.Select
        If wsLoja.Range("K12").Value = 105 Then
            wsLoja.Range("E11:I13").ClearContents
        End If
    
        Sheets(Estado).Visible = False
       
        GoTo Fim

    End With

    Exit Sub
Fim:
   'Clean up the Outlook application.
    Set BuscaEstado = Nothing
    Set OlMensagem = Nothing
    Set olapp = Nothing
    Set wb = Nothing
    Set wsEN = Nothing
    Set wsSendConvite = Nothing
    Set wsLoja = Nothing
    Set wsEstado = Nothing
   
End Sub
 
Postado : 16/04/2016 5:43 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Cara, final de semana (começando na sexta após as 17:00 eu não mexo no computador...

Pra mim fica um pouco complicado testar o que estou fazendo pois não possuo as informações nem nada... se puder alterar as informações contidas na planilha e me enviar para poder visualizar melhor e efetuar os testes fica mais fácil. (na verdade nem testes eu realizo, apenas as alterações mesmo às cegas...)

Option Explicit
Dim assinatura As Variant

Public Function pega_assinatura(ByVal sFile As String) As String 'Dick Kusleika
Dim fso As Object
Dim ts As Object

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
    
    pega_assinatura = ts.ReadAll
    ts.Close

    Set fso = Nothing
    Set ts = Nothing
    
End Function

Sub XA_Lojas_Convites()
'Setting up the Excel variables.
Dim olapp           As Outlook.Application
Dim OlMensagem      As Outlook.MailItem
Dim objMail         As MailItem
Dim wb              As Workbook
Dim wsEN            As Worksheet
Dim wsLoja          As Worksheet
Dim wsEstado        As Worksheet
Dim wsSendConvite   As Worksheet
Dim iCounter        As Integer
Dim Dest            As Variant
Dim SDest           As String
Dim Estado          As String
Dim BuscaEstado     As Range
Dim AbrevEstado     As String
Dim Leitura         As String
Dim contaEmail      As String
Dim idEmail         As Integer
Dim strbody         As String
Dim Loja            As String
Dim Caminho         As String
Dim CaminhoAssin    As String
Dim Quebralin1      As String
Dim QuebraLin2      As String
Dim ContCopy        As Long
Dim i               As Long
Dim j               As Long
Dim w               As Long
Dim Col             As Long
Dim Lin             As Long

    Set wb = ThisWorkbook
    Set wsEN = wb.Worksheets("EN")
    Set wsSendConvite = wb.Worksheets("Enviar Convites")
    Set olapp = Outlook.Application
    Set objMail = olapp.CreateItem(olMailItem) 'Create mail item
    Quebralin1 = "<br>"
    QuebraLin2 = "<br><br>"
    Caminho = "C:UsersAndreDesktopPedidos Gauer"
    CaminhoAssin = "C:Assinaturas"
    
'------------------------------------------------------------
    
    If Range("I8").Value = "Amigo Lojista" Or Range("I8").Value = "Vendas Energy" Then
        assinatura = pega_assinatura(CaminhoAssin & "Amigo.htm")
    Else
        If Range("I8").Value = "Gauer do Brasil - André" Or Range("I8").Value = "Vendas Gauer" Then
            assinatura = pega_assinatura(CaminhoAssin & "Gauer.htm")
        Else
            assinatura = pega_assinatura(CaminhoAssin & "Leader.htm")
        End If
    End If

    '  Enviar Convites Lojas
    For i = 11 To 13
        For j = 5 To 9
            ContCopy = ContCopy + 1
            If wb.ActiveSheet.Cells(i, j).Value = "" Then
                Run "Copiar" & ContCopy
                GoTo Segue
            End If
        Next j
    Next i
    
    Run "Copiar1"
    
Segue:

    Loja = wb.ActiveSheet.Range("A1").Value
    Set wsLoja = wb.Worksheets(Loja)
    
    If wb.ActiveSheet.Range("K4").Value = 1 Then
        strbody = "<H2>" & _
                    wsSendConvite.Range("V2").Value & _
                "</H2>" & _
                "<H3 style='color: #870c0c'>" & _
                    wsSendConvite.Range("V6").Value & _
                "</H3>" & _
                "<H3>" & _
                    wsSendConvite.Range("V10").Value & QuebraLin2 & _
                    wsSendConvite.Range("V14").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z18").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z22").Value & _
                "</H3>" & _
                QuebraLin2 & "<B>Obrigado por ser nosso parceiro, conte comigo!!</B>" & QuebraLin2
    Else
        strbody = "<H2>" & _
                    wsSendConvite.Range("Z2").Value & _
                "</H2>" & _
                "<H3 style='color: #870c0c'>" & _
                    wsSendConvite.Range("Z6").Value & _
                "</H3>" & _
                "<H3>" & _
                    wsSendConvite.Range("Z10").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z14").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z18").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z22").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z23").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z24").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z25").Value & QuebraLin2 & _
                    wsSendConvite.Range("Z26").Value & _
                "</H3>" & _
                QuebraLin2 & "<B>Obrigado por ser nosso parceiro, conte comigo!!</B>" & QuebraLin2
    End If

Saltar:

    Leitura = wsLoja.Range("I7").Value
    Estado = Application.Caller
    Application.ScreenUpdating = False
    Set wsEstado = wb.Worksheets(Estado)
    wsEstado.Visible = True

    Application.DisplayAlerts = False   'desabilite o alerta

    wb.ActiveSheet.Range("L2").Select

    Set BuscaEstado = wb.ActiveSheet.Range("A3:A8").Find(Estado, LookIn:=xlValues, LookAt:=xlWhole)
    
    If BuscaEstado Is Nothing Then
        MsgBox "Estado não localizado"
        GoTo Fim
    Else
        AbrevEstado = wsLoja.Cells(BuscaEstado.Row, 1).Value
    End If
    
    ' Preste atencao aqui
      contaEmail = wsLoja.Range("I8").Value
    
    'Quero que aqui, ao inves de ter RJ tenha a variavel Estado que vai estar associado ao click na     regiao do mapa.
    wb.Worksheets(AbrevEstado).Select
   
    iCounter = 2 'inicia na linha 2
   
    'Create the Outlook application and the empty email.
    Set olapp = CreateObject("Outlook.Application")
    
    If wb.ActiveSheet.Cells(22, 11).Value <> 1 Then GoTo Bloco
    
    For Col = 7 To 33
        For Lin = 2 To 99
            If wsEN.Cells(Lin, Col).Value = Empty Then Next Lin
Bloco:
            
            Set OlMensagem = olapp.CreateItem(0)
        
        '------------------------------------------------------------------------------
           
           'Este laço verifica se o nome da conta w no registro do windows é igual ao valor da célula
            For w = 1 To olapp.Session.Accounts.Count
                If olapp.Session.Accounts.Item(w).DisplayName = contaEmail Then 'Se for verdadeiro, solicita confirmação
                    If MsgBox("O E-mail será enviado usando a conta " & contaEmail & ". Confirma ?" & "    ( Estado - " & Estado & " )", vbQuestion + vbYesNo, "Envio de e-mail") = vbYes Then
                        idEmail = w 'Define o id da conta para o comando enviar
                        Exit For 'Sai do laço
                    Else
                         wsEstado.Visible = False
                         wsLoja.Select
                        GoTo Fim 'Senão sai da rotina
                    End If
                End If
            Next
        '-------------------------------------------------------------------------------
        'Using the email, add multiple recipients, using a list of addresses in column C.
            With OlMensagem
                
                If wb.ActiveSheet.Cells(22, 11).Value <> 1 Then GoTo BlocoEndereco: SDest = wsEN.Cells(Lin, Col).Value
                
                For iCounter = 2 To WorksheetFunction.CountA(Columns(3))  ' Linha 2 da coluna 3
                
                 'Sheets("Email").Select
                    SDest = SDest & ";" & Cells(iCounter, 3).Value
                Next iCounter
                  
BlocoEndereco:
                  
            '     Sheets("parar").Select
                 
                      
                'Do additional formatting on the BCC and Subject lines, add the body text from the spreadsheet, and send.
                   .Display
                   
                If wsSendConvite.Range("Q15").Value = 1 Then
                    .BCC = SDest
                Else
                    .To = SDest
                End If
            
                If wsSendConvite.Range("K4").Value = 1 Then
                    .Subject = "Tabela de Pedidos da Gauer do Brasil"
                Else
                    .Subject = "Tabela de Pedidos da Leader Nutrition"
                End If
        '------------------------------------------------------------------
                .BodyFormat = olFormatHTML
                .HTMLBody = strbody & Quebralin1 & assinatura & .HTMLBody
                   
                For i = 1 To 4
                    If wsLoja.Range("F" & i).Value > 0 Then
                        .Attachments.Add Caminho & wsLoja.Range("F" & i).Value & wsLoja.Range("I" & i).Value
                    End If
                Next i
                
                
                .ReadReceiptRequested = Leitura ' confirmação de leitura
                .SendUsingAccount = olapp.Session.Accounts.Item(idEmail)
                
                If wsLoja.Range("I6").Value = "SEND" Then
                    .Send
                Else
        '-----------------------------------------
        
                
                
                    .Display
                End If
            
                wsEN.Select
                ' Limpar Email Planilha EN ( Enviar Convites)
                wsEN.Range("C1:C99").ClearContents
                wsEN.Range("D1").Select
            
                wsLoja.Select
                If wsLoja.Range("K12").Value = 105 Then
                    wsLoja.Range("E11:I13").ClearContents
                End If
            
                Sheets(Estado).Visible = False
               
                GoTo Fim
        
            End With
        
        If wb.ActiveSheet.Cells(22, 11).Value <> 1 Then GoTo FimBloco

        Next Lin
    Next Col
    
FimBloco:

    Exit Sub
Fim:
   'Clean up the Outlook application.
    Set BuscaEstado = Nothing
    Set OlMensagem = Nothing
    Set olapp = Nothing
    Set wb = Nothing
    Set wsEN = Nothing
    Set wsSendConvite = Nothing
    Set wsLoja = Nothing
    Set wsEstado = Nothing
   
End Sub

Qualquer coisa da o grito.
Abraço

 
Postado : 18/04/2016 6:32 am
(@fazerbem)
Posts: 0
New Member
Topic starter
 

Ola amgo, boa noite, amanha eu vejo testo e com certeza falo. Por hora muito obrigado.

 
Postado : 18/04/2016 6:30 pm
(@fazerbem)
Posts: 0
New Member
Topic starter
 

Bom dia

deu erro aqui ( Next sem For )

If wsEN.Cells(Lin, Col).Value = Empty Then ( Next ) Lin

A parte de enviar emails um a um se a celula Q22 estiver = 1 esta implantado ?

Lembrando que existe um limite diario no Gmail de 500 envios, e na minha aba ( EN ) os emails estao em G2:G99 pula 1 coluna I2:I99, pula uma coluna .......indo assim ate a AG.
Portanto acho que o certo seria colocar um contador e fazer parar no envio de numero 500, dai terei a opcao de fazer o restante dos envios usando outra conta que ganharei mais 500 envios, ou enviar na memsa conta no dia seguinte.

grato

 
Postado : 19/04/2016 7:46 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

A parte de enviar emails um a um se a celula Q22 estiver = 1 esta implantado ?
Está sim cara...

Podemos fazer isso de forma automática essa troca de emails ou contagem, tanto faz...

Não tem como disponibilizar a planilha?

 
Postado : 19/04/2016 8:12 am
(@fazerbem)
Posts: 0
New Member
Topic starter
 

Mando em Anexo, Bernardo, parte da Planilha pra te facilitar.

Porem na ABA EN apaguei os emails ok.

Andre

 
Postado : 19/04/2016 8:12 am
(@fazerbem)
Posts: 0
New Member
Topic starter
 

A planilha inteira tem 4434kb e ali tem dados confidenciais, por isso enviei apenas 2 das abas, pois esta planilha fucniona como um gerenciador alem de envio de emails.

 
Postado : 19/04/2016 8:14 am
Página 2 / 4