on 11-14-2016 9:44 AM
Please can you anybody advise me how to get the code in powerbuilder using 11.2 . I am using Microsoft exchange dlls for this
private void button2_Click(object sender, EventArgs e)
{
try
{
ExchangeService service = new ExchangeService();
string username = mycompany+ "\\" + "usersid";
service.Credentials = new WebCredentials(username, "myusername");
service.AutodiscoverUrl("myname@mycompany.com");
Appointment appointment = new Appointment(service);
appointment.Subject = "Testing Holiday";
appointment.Start = DateTime.Now;
appointment.End = appointment.Start.AddHours(1);
appointment.Save();
}
catch (Exception ex)
{
MessageBox.Show("The following error occurred: " + ex.Message);
}
}
Take a look at this article on how to call .Net from PowerBuilder.
http://blogs.artinsoft.net/Mrojas/archive/2009/03/03/Calling-NET-from-PowerBuilder.aspx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In the old forum they did more or less the same question. And this was what they found:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I googled this and it appears that the API you are using is only available to .Net applications. You could create a COM control in C# and then call it from PowerBuilder. I haven't done that myself but I know it is possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Polachan,
Here is an extract from my code:
...
...
s_inhalt = 'TEXT'
l_outlook_mm = long(s_inhalt)
s_categories = ''
ole_outlook = Create OLEObject
l_result = ole_outlook.ConnectToNewObject("outlook.application")
if l_result = 0 then
ole_item = ole_outlook.CreateItem(1)
l_beginn_zeit = '08:00'
l_reminder_outlook = 1
s_attendees_outlook = ''1
s_required_attendees = ''
l_show_kategories = 1
if isnull( l_show_kategories ) then l_show_kategories = 0
if isnull(l_beginn_zeit) then l_beginn_zeit = 0
ti_zeit = time(string(l_beginn_zeit,'00:00') + ':00.000000' )
dti_beginn_datum = datetime(date(dti_beginn_datum),ti_zeit)
ole_item.start = dti_beginn_datum
ole_item.categories = s_categories
if l_show_kategories = 1 then
ole_item.showcategoriesdialog
end if
dti_ende_datum = '11.01.2016'
if isnull(dti_ende_datum) then dti_ende_datum = dti_beginn_datum
l_ende_zeit = '11:30'
if isnull(l_ende_zeit) then l_ende_zeit = l_beginn_zeit
ti_zeit = time(string(l_ende_zeit,'00:00') + ':00.000000' )
dti_ende_datum = datetime(date(dti_ende_datum),ti_zeit)
ole_item.end = dti_ende_datum
l_termin_art = 1
if isnull(l_termin_art) then l_termin_art = 0
s_termin_art_bez = 'TEST'
s_subject = s_termin_art_bez + ' ' + string(l_kdnr) + ' ' + s_name_und_ort
ole_item.subject = s_subject
s_body = ''
if isnull(s_stichwort) then s_stichwort = ''
if isnull(s_notiz) then s_notiz = ''
if len(s_stichwort) > 0 then
s_body = s_body + s_stichwort + '~r~n' + '~r~n'
end if
if len(s_notiz) > 0 then
s_body = s_body + s_notiz + '~r~n' + '~r~n'
end if
ole_item.body = s_body
s_termin_ort = 'ORT'
if len(trim(s_termin_ort)) > 0 then ole_item.Location = s_termin_ort
if l_reminder_outlook > 0 then
ole_item.reminderSet = True
ole_item.reminderminutesbeforestart = l_reminder_outlook
end if
if not ( isnull( s_required_attendees ) or len( trim( s_required_attendees ) ) = 0 ) then
ole_item.requiredattendees = s_required_attendees
end if
if not ( isnull( s_attendees_outlook ) or len( trim( s_attendees_outlook ) ) = 0 ) then
ole_item.optionalattendees = s_attendees_outlook
end if
ole_item.save
ole_item.display
l_result = ole_outlook.disconnectObject()
destroy ole_item
destroy ole_outlook
end if
...
...
I hope you understand it. You must translate German words if you are unknown.
André Rust
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
10 | |
9 | |
9 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.