forhåbentligt let spørgsmål ".from"
Hejjeg benytte denne makro til automatisk at sende en mail ud:
Sub Mail_Range_Outlook_Body_XX()
' Don't forget to copy the function RangetoHTML in the module.
' Working in Office 2000-2010
Sheets("mail").Range("f32").Select
ActiveCell.FormulaR1C1 = "1"
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set rng = Nothing
On Error Resume Next
Set rng = Sheets("kreditark").Range("a1:f42").SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If rng Is Nothing Then
msgbox "The selection is not a range or the sheet is protected" & _
vbNewLine & "please correct and try again.", vbOKOnly
Exit Sub
End If
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = Sheets("mail").Range("g3").Value
.CC = "xx@xx.dk"
.BCC = ""
.Subject = Sheets("mail").Range("l5").Value
.HTMLBody = RangetoHTML(rng)
.Display 'or use .Send
End With
On Error GoTo 0
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
[b]Mit spørgsmål er om, der er nogen, der ved hvorfor man ikke kan definere en fast afsender mailadresse, f.eks. som .from eller lignende?
Hedder det bare noget andet end .from???[\b]
PFT