davekl Absent Member.
Absent Member.
2264 views

Proxy Posted Appointment

Hello,

I've written a simple function to post an appointment in vba (ms access) and it works fine on my groupwise calendar but I need to post it to a calendar that I have proxy access to.

I'm new to this API, so detailed instructions in vba would be appreciated. My function is below.

Thanks in advance!

Function GWPostApp(appDate As String, appDuration As Integer, appSubject As String, appVenue As String, appBody As String)

Dim objGWApp As Application2
Dim objGWAccount As Account2

'Create and login to the application object.
Set objGWApp = New Application2

'Log in to a new mailbox object using the application object
Set objGWAccount = objGWApp.Login

'Add a new message/task object to the calendar.
Set objGWTask = objGWAccount.Calendar.Messages.Add("GW.MESSAGE.APPOINTMENT", egwPersonal)

'Set Appointment Properties
With objGWTask
.StartDate = appDate
.Duration = appDuration / 24
.Subject = appSubject
.Place = appVenue
.OnCalendar = True
.BusyType = egwBlocked
.BodyText = appBody
.NotifyWhenDeleted = 0
End With

MsgBox "Appointment Successfully Posted!"

'Clear up the objects
Set objGWTask = Nothing
Set objGWAccount = Nothing
Set objGWApp = Nothing

End Function


Regards,

Dave
Labels (1)
0 Likes
2 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Proxy Posted Appointment

Hi,

after your login to your "main account" you have to 'Proxy()' to yr proxy account;
the rest is identical as in your existing function; just use the returned account
object of the Proxy() function. BTW: the Proxy() function is a method of the
Application object!

Markus




"davekl" <davekl@no-mx.forums.novell.com> schrieb im Newsbeitrag
news:davekl.3qdim0@no-mx.forums.novell.com...
>
> Hello,
>
> I've written a simple function to post an appointment in vba (ms
> access) and it works fine on my groupwise calendar but I need to post it
> to a calendar that I have proxy access to.
>
> I'm new to this API, so detailed instructions in vba would be
> appreciated. My function is below.
>
> Thanks in advance!
>
>
> Code:
> --------------------
> Function GWPostApp(appDate As String, appDuration As Integer, appSubject As
> String, appVenue As String, appBody As String)
>
> Dim objGWApp As Application2
> Dim objGWAccount As Account2
>
> 'Create and login to the application object.
> Set objGWApp = New Application2
>
> 'Log in to a new mailbox object using the application object
> Set objGWAccount = objGWApp.Login
>
> 'Add a new message/task object to the calendar.
> Set objGWTask = objGWAccount.Calendar.Messages.Add("GW.MESSAGE.APPOINTMENT",
> egwPersonal)
>
> 'Set Appointment Properties
> With objGWTask
> .StartDate = appDate
> .Duration = appDuration / 24
> .Subject = appSubject
> .Place = appVenue
> .OnCalendar = True
> .BusyType = egwBlocked
> .BodyText = appBody
> .NotifyWhenDeleted = 0
> End With
>
> MsgBox "Appointment Successfully Posted!"
>
> 'Clear up the objects
> Set objGWTask = Nothing
> Set objGWAccount = Nothing
> Set objGWApp = Nothing
>
> End Function
> --------------------
>
>
> Regards,
>
> Dave
>
>
> --
> davekl
> ------------------------------------------------------------------------
> davekl's Profile: http://forums.novell.com/member.php?userid=49884
> View this thread: http://forums.novell.com/showthread.php?t=368881
>



0 Likes
davekl Absent Member.
Absent Member.

Re: Proxy Posted Appointment

Excellent! Thank you Markus, it was much easier that I thought it would be!

Much appreciated.

Dave

Markus Colorado;1773292 wrote:
Hi,

after your login to your "main account" you have to 'Proxy()' to yr proxy account;
the rest is identical as in your existing function; just use the returned account
object of the Proxy() function. BTW: the Proxy() function is a method of the
Application object!

Markus




"davekl" <davekl@no-mx.forums.novell.com> schrieb im Newsbeitrag
news:davekl.3qdim0@no-mx.forums.novell.com...
>
> Hello,
>
> I've written a simple function to post an appointment in vba (ms
> access) and it works fine on my groupwise calendar but I need to post it
> to a calendar that I have proxy access to.
>
> I'm new to this API, so detailed instructions in vba would be
> appreciated. My function is below.
>
> Thanks in advance!
>
>
> Code:
> --------------------
> Function GWPostApp(appDate As String, appDuration As Integer, appSubject As
> String, appVenue As String, appBody As String)
>
> Dim objGWApp As Application2
> Dim objGWAccount As Account2
>
> 'Create and login to the application object.
> Set objGWApp = New Application2
>
> 'Log in to a new mailbox object using the application object
> Set objGWAccount = objGWApp.Login
>
> 'Add a new message/task object to the calendar.
> Set objGWTask = objGWAccount.Calendar.Messages.Add("GW.MESSAGE.APPOINTMENT",
> egwPersonal)
>
> 'Set Appointment Properties
> With objGWTask
> .StartDate = appDate
> .Duration = appDuration / 24
> .Subject = appSubject
> .Place = appVenue
> .OnCalendar = True
> .BusyType = egwBlocked
> .BodyText = appBody
> .NotifyWhenDeleted = 0
> End With
>
> MsgBox "Appointment Successfully Posted!"
>
> 'Clear up the objects
> Set objGWTask = Nothing
> Set objGWAccount = Nothing
> Set objGWApp = Nothing
>
> End Function
> --------------------
>
>
> Regards,
>
> Dave
>
>
> --
> davekl
> ------------------------------------------------------------------------
> davekl's Profile: NOVELL FORUMS - View Profile: davekl
> View this thread: Proxy Posted Appointment - NOVELL FORUMS
>
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.