waarom doet de code het niet???

Status
Niet open voor verdere reacties.

phobia

Terugkerende gebruiker
Lid geworden
4 sep 2006
Berichten
1.777
Ik krijg "eigenschap of methode wordt niet ondersteund in dit opject"

Ik heb het gedraaid op xp en office 2003, xp en office 2007 en vista en office2007

Code:
Private Sub Knop84_Click()
On Error GoTo Err_Knop84_Click

    Dim stDocName As String
    Dim strRecipients As String
    Dim HTMLTemp As String


    strRecipients = email
    stDocName = "werknemers"
    HTMLTemp = "C:\Temp\werknemers.html"
    
    DoCmd.OutputTo acReport, stDocName, acFormatHTML, HTMLTemp, False

DoCmd.CancelEvent


Set objMessage = CreateObject("CDO.Message")
objMessage.subject = "Snipper Overzicht"
objMessage.From = "info@brillehuus.nl"
objMessage.To = email
'The line below shows how to send using HTML included directly in your script
'.objMessage.HTMLBody = Bodyhtml
'The line below shows how to send a webpage from a remote site
'objMessage.CreateMHTMLBody "http://www.paulsadowski.com/wsh/"

'The line below shows how to send a webpage from a file on your machine
'objMessage.CreateHTMLBody = "c:/temp/werknemers.html"

objMessage.Bcc = "morphius.inc@upcmail.nl"
objMessage.Cc = "g.gieling@chello.nl"

objMessage.Display

 
Exit_Knop84_Click:
    Exit Sub

Err_Knop84_Click:
    MsgBox Err.Description
    Resume Exit_Knop84_Click
    
End Sub
 
Laatst bewerkt door een moderator:
Ik heb hier een mail functie die het doet. Mogelijk dat je hem verder naar je wens kan aanpassen


Code:
Sub MailVersturenViaOutlook()
'Working in 2000-2007
'This example send the last saved version of the Activeworkbook
    Dim OutApp As Object
    Dim OutMail As Object

    Set OutApp = CreateObject("Outlook.Application")
    OutApp.Session.Logon
    Set OutMail = OutApp.CreateItem(0)

    On Error Resume Next
    With OutMail
        .To = "Mail@domein.nl"
        .CC = ""
        .BCC = ""
        .Subject = "This is the Subject line"
        .Body = "Hi there"
        .Attachments.Add ActiveWorkbook.FullName
        'You can add other files also like this
        '.Attachments.Add ("C:\test.txt")
        .Display   'or use .Send
    End With
    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub
 
Laatst bewerkt door een moderator:
Code:
Dim objMessage, Rcpt



Rcpt = email
Set objMessage = CreateObject("CDO.Message")
objMessage.subject = "Snipper Overzicht"
objMessage.FROM = """t Brillehuus"" [email]g.gieling@chello.nl[/email]"
objMessage.To = Rcpt

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
'Open the file for reading
Set f = fso.OpenTextFile("c:\temp\werknemers.html", ForReading)
'The ReadAll method reads the entire file into the variable BodyText
BodyText = f.ReadAll
'Close the file
f.Close
Set f = Nothing
Set fso = Nothing

objMessage.HTMLBody = BodyText
objMessage.Send

Zo doet hij het wel bij mij en rood laad een html file kun je het in je mail body zetten.!!
 
Laatst bewerkt door een moderator:
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan