Outlook 2002 sikkerhedsproblem ??????
Hej håber I kan forstå dette da det følgende er påengelsk....
Svar ønskes på dansk og på forhånd tak.
The following code is assigned to a button in access
2002 but this error we cannot get rid of why ????
Access have to control outlook 2002 here and that
seems to be dificault.
Run-time Error
Application-defined or object-defined error
in the line
olMail.Send
The access code follows:
Private Sub Command2_Click()
Dim db As Recordset
Set rs = CurrentDb.openrecordset(\"person\")
Do Until rs.EOF
\' Start Outlook.
\' If it is already running, you\'ll use the same instance...
Dim olApp As Outlook.Application
Set olApp = CreateObject(\"Outlook.Application\")
\' Logon. Doesn\'t hurt if you are already running and logged on...
Dim olNs As Outlook.NameSpace
Set olNs = olApp.GetNamespace(\"MAPI\")
olNs.Logon
\' Send a message to your new contact.
Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)
\' Fill out & send message...
MsgBox rs(\"email\")
olMail.To = rs(\"email\")
olMail.Subject = \"Nyhedsbrev\"
MsgBox Brødtekst
olMail.Body = Brødtekst & vbCrLf
olMail.Send
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Sub
