Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #109920

Re: help with loop code

From eltyar <eltyar.130fead8@excelbanter.com>
Newsgroups microsoft.public.excel.programming
Subject Re: help with loop code
Date 2017-03-16 06:43 +0000
Message-ID <eltyar.130fead8@excelbanter.com> (permalink)
Organization ExcelBanter.com
References <eltyar.130f09d8@excelbanter.com> <oabl27$79n$1@dont-email.me>

Show all headers | View raw


Dear Claus
thanks i appreciate your replay

here is my all code (this code to send emails directly to my customers
from excel) because when i added yours it's not working

Code:
Sub sendmail()
i = 4
Do


EmailTo = Cells(i, "J").Value
CCto = Cells(i, "K").Value
Subj = Cells(i, "L").Value
Filepath = Cells(i, "M").Value
msg = Cells(i, "N").Value


Application.DisplayAlerts = False

Dim OutApp As Object
Dim OutMail As Object
Dim SigString As String
Dim Signature As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

SigString = Environ("appdata") & _
"\Microsoft\Signatures\mrm.htm"

If Dir(SigString) <> "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If
On Error Resume Next
With OutMail
To = EmailTo
CC = CCto
BCC = ""
Subject = Subj
HTMLBody = msg & "<br>" & Signature
'.body = msg & vbNewLine & vbNewLine & Signature
Attachments.Add Filepath
Display    '.Send   'or use .Display

End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing



Application.DisplayAlerts = True

i = i + 1
Cells(1, "J").Value = "Outlook sent Time,Dynamic msg preview  count  ="
& i - 3
Loop While Cells(i, "P").Value = "ok"


End Sub


thanks again for ur kind help




-- 
eltyar

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

help with loop code eltyar <eltyar.130f09d8@excelbanter.com> - 2017-03-15 14:24 +0000
  Re: help with loop code Claus Busch <claus_busch@t-online.de> - 2017-03-15 16:05 +0100
    Re: help with loop code eltyar <eltyar.130fead8@excelbanter.com> - 2017-03-16 06:43 +0000

csiph-web