Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

VBA Outlook Change Dir / Calendar

WhiteFox_WhiteFox_ Member Posts: 2
it would be great if one of you could share how to change the dir outlook via VBA code.
all i need to do is go from one users calendar to another and post an apointment. ive gotten down how to post, but no matter what i try i cant get it into another users acount. i am able to do this by opening the calendar and changeing it manualy.
is it possible to do this in "ThisCurrentSession" in VBA or do i have to use an anonmous MAPI sign in through exchange?

Comments

  • WhiteFox_WhiteFox_ Member Posts: 2
    : it would be great if one of you could share how to change the dir outlook via VBA code.
    : all i need to do is go from one users calendar to another and post an apointment. ive gotten down how to post, but no matter what i try i cant get it into another users acount. i am able to do this by opening the calendar and changeing it manualy.
    : is it possible to do this in "ThisCurrentSession" in VBA or do i have to use an anonmous MAPI sign in through exchange?
    :

    Wow, after a week of searching i descovered how.

    Private Sub cmdGo_Click()
    Set myOlApp = CreateObject("Outlook.Application")
    Set myNameSpace = myOlApp.GetNamespace("MAPI")
    Set myRecipient = myNameSpace.CreateRecipient("Ed McMan")
    Set hisCalendar = myNameSpace.GetSharedDefaultFolder(myRecipient, olFolderCalendar)
    Dim A As AppointmentItem
    Set A = CreateItem(olAppointmentItem)
    A.Subject = "Test Event - " & txtCase
    A.Start = txtDate
    A.End = txtDate
    A.Duration = 60
    A.AllDayEvent = True 'must have a duration
    A.Save
    A.Move hisCalendar
    End Sub

    lol, i hope i help someone else out there with this porblem.

  • Justin BibJustin Bib USAMember Posts: 0

    ________ ( http://forcoder.org ) free video tutorials and ebooks about [ R, MATLAB, Python, Visual Basic, JavaScript, Objective-C, Java, Visual Basic .NET, Swift, Assembly, Perl, PL/SQL, Delphi, Scratch, C++, PHP, Go, C#, Ruby, C Erlang, F#, Scheme, Lua, Bash, Rust, Scala, Awk, Lisp, Prolog, Alice, LabVIEW, Hack, Julia, D, COBOL, Logo, ML, Crystal, SAS, Clojure, FoxPro, ABAP, Apex, Transact-SQL, Kotlin, Dart, VBScript, Fortran, Ada ] ______

Sign In or Register to comment.