ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set E-Mail Importance with code (https://www.excelbanter.com/excel-programming/376633-set-e-mail-importance-code.html)

Les Stout[_2_]

Set E-Mail Importance with code
 
Hi, i am using Ron de Bruyns e-mail code and it works 100% but i would
like to set the Importance to high with code before it gets sent.

With OutMail
.To = EmailAddr
.CC = ccAdd
.BCC = ""
.Subject = Subj
.Body = BodyText
.ImportanceHigh = True **** Does not work ??
.ReadReceiptRequested = True
.Attachments.Add ActiveWorkbook.FullName
.Display 'send
End With

Any help would be appreciated.

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

Ron de Bruin

Set E-Mail Importance with code
 
Use

.Importance = 2

I will add a few things to my tips page soon

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Les Stout" wrote in message ...
Hi, i am using Ron de Bruyns e-mail code and it works 100% but i would
like to set the Importance to high with code before it gets sent.

With OutMail
.To = EmailAddr
.CC = ccAdd
.BCC = ""
.Subject = Subj
.Body = BodyText
.ImportanceHigh = True **** Does not work ??
.ReadReceiptRequested = True
.Attachments.Add ActiveWorkbook.FullName
.Display 'send
End With

Any help would be appreciated.

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***




Les Stout[_2_]

Set E-Mail Importance with code
 
Dankie Ron. Ron can you help out with some code to create an Autofilter
on a spreadsheet. I was using the code below but now it gives me an
error !!

Rows("1:1").Select
' Selection.AutoFilter
Selection.AutoFilter Field:=10, Criteria1:="=*ZA-T-M-*",
Operator:=xlAnd
Selection.AutoFilter Field:=10, Criteria1:="=*za-t-m-**",
Operator:=xlAnd
With Worksheets("Tabelle1")
If
..AutoFilter.Range.Columns(1).Cells.SpecialCells(x lCellTypeVisible) _
.Count = 1 Then
Else
With .AutoFilter.Range
.Resize(.Rows.Count - 1).Offset(1, 0).EntireRow.Delete
End With
End If
End With
Selection.AutoFilter Field:=10


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

Ron de Bruin

Set E-Mail Importance with code
 
Hi Less

If you use And then use it like this

Example from my site :
Replace ron and dave to your criteria

Sub Delete_with_Autofilter_Array()
Dim Rng As Range
Dim I As Long
Dim myArr As Variant myArr = Array("ron", "Dave")
For I = LBound(myArr) To UBound(myArr) ActiveSheet.Range("A1:A100").AutoFilter Field:=1, Criteria1:=myArr(I)
With ActiveSheet.AutoFilter.Range
Set rng = Nothing
On Error Resume Next
Set Rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not Rng Is Nothing Then Rng.EntireRow.Delete
End With
Next I
ActiveSheet.AutoFilterMode = False
End Sub
--
Regards Ron de Bruin
http://www.rondebruin.nl



"Les Stout" wrote in message ...
Dankie Ron. Ron can you help out with some code to create an Autofilter
on a spreadsheet. I was using the code below but now it gives me an
error !!

Rows("1:1").Select
' Selection.AutoFilter
Selection.AutoFilter Field:=10, Criteria1:="=*ZA-T-M-*",
Operator:=xlAnd
Selection.AutoFilter Field:=10, Criteria1:="=*za-t-m-**",
Operator:=xlAnd
With Worksheets("Tabelle1")
If
AutoFilter.Range.Columns(1).Cells.SpecialCells(xlC ellTypeVisible) _
.Count = 1 Then
Else
With .AutoFilter.Range
.Resize(.Rows.Count - 1).Offset(1, 0).EntireRow.Delete
End With
End If
End With
Selection.AutoFilter Field:=10


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***




Ron de Bruin

Set E-Mail Importance with code
 
This is better

Sub Delete_with_Autofilter_Array()
Dim Rng As Range
Dim I As Long
Dim myArr As Variant

myArr = Array("ron", "Dave")
For I = LBound(myArr) To UBound(myArr)

ActiveSheet.Range("A1:A100").AutoFilter Field:=1, Criteria1:=myArr(I)
With ActiveSheet.AutoFilter.Range
Set rng = Nothing
On Error Resume Next
Set Rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not Rng Is Nothing Then Rng.EntireRow.Delete
End With
Next I
ActiveSheet.AutoFilterMode = False
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Ron de Bruin" wrote in message ...
Hi Less

If you use And then use it like this

Example from my site :
Replace ron and dave to your criteria

Sub Delete_with_Autofilter_Array()
Dim Rng As Range
Dim I As Long
Dim myArr As Variant myArr = Array("ron", "Dave")
For I = LBound(myArr) To UBound(myArr) ActiveSheet.Range("A1:A100").AutoFilter Field:=1, Criteria1:=myArr(I)
With ActiveSheet.AutoFilter.Range
Set rng = Nothing
On Error Resume Next
Set Rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not Rng Is Nothing Then Rng.EntireRow.Delete
End With
Next I
ActiveSheet.AutoFilterMode = False
End Sub
--
Regards Ron de Bruin
http://www.rondebruin.nl



"Les Stout" wrote in message ...
Dankie Ron. Ron can you help out with some code to create an Autofilter
on a spreadsheet. I was using the code below but now it gives me an
error !!

Rows("1:1").Select
' Selection.AutoFilter
Selection.AutoFilter Field:=10, Criteria1:="=*ZA-T-M-*",
Operator:=xlAnd
Selection.AutoFilter Field:=10, Criteria1:="=*za-t-m-**",
Operator:=xlAnd
With Worksheets("Tabelle1")
If
AutoFilter.Range.Columns(1).Cells.SpecialCells(xlC ellTypeVisible) _
.Count = 1 Then
Else
With .AutoFilter.Range
.Resize(.Rows.Count - 1).Offset(1, 0).EntireRow.Delete
End With
End If
End With
Selection.AutoFilter Field:=10


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***






Les Stout[_2_]

Set E-Mail Importance with code
 
Dankie Ron, jammer vir die laat antwort. Ek het dit probeer en dit het
gut gewerk.

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***

Ron de Bruin

Set E-Mail Importance with code
 
Hoi Les
Hi Les

Fijn dat het werkt
Good to hear that it is working

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Les Stout" wrote in message ...
Dankie Ron, jammer vir die laat antwort. Ek het dit probeer en dit het
gut gewerk.

Les Stout

*** Sent via Developersdex http://www.developersdex.com ***





All times are GMT +1. The time now is 09:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com