Set E-Mail Importance with code

  • Thread starter Thread starter Les Stout
  • Start date Start date
L

Les Stout

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
 
Use

.Importance = 2

I will add a few things to my tips page soon
 
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(xlCellTypeVisible) _
.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
 
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
 
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
 
Dankie Ron, jammer vir die laat antwort. Ek het dit probeer en dit het
gut gewerk.

Les Stout
 
Hoi Les
Hi Les

Fijn dat het werkt
Good to hear that it is working
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top