Home |
Search |
Today's Posts |
#3
![]() |
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
code won't loop | Excel Programming | |||
Add Loop to code | Excel Programming | |||
Help with better loop code | Excel Programming | |||
How to Loop some code | Excel Discussion (Misc queries) | |||
VBE code in a loop | Excel Programming |