Avatar of johnnywong71
johnnywong71

asked on 

Error in the SendUsingAccount and Organizer

I wrote a form with the code below:

    Set objOutlook = CreateObject("Outlook.Application")
    Set objAppt = objOutlook.CreateItem(olAppointmentItem)
Msgbox "test"
    With objAppt
        .Start = StartString
        .Organizer = "otheraccount"
        .SendUsingAccount = "otheraccount"    
        .duration = DurationString
        .Subject = [Mynote]
        .Body = BodyString
        .Location = ""
        .ReminderMinutesBeforeStart = "15"
        .ReminderSet = True
        .ResponseRequested = True

        .MeetingStatus = olMeeting
        Set Recip = .Recipients.Add(ScheduleTech.Column(0))
        Recip.Type = olRequired
        .Save
        .Send

    End With


It worked before.  I found that it is because the line of
        .Organizer = "otheraccount"
        .SendUsingAccount = "otheraccount"    
If I command it out, it works.  If not, it cannot even display the "test" message.
Could you tell me why?
Is it the upgrade for the office cause the issue?
VB ScriptVisual Basic.NETVisual Basic Classic

Avatar of undefined
Last Comment
purplepomegranite

8/22/2022 - Mon