Quantcast
Channel: Outlook for Developers forum
Viewing all 6421 articles
Browse latest View live

Intercepting the Save & Close button in appointment windows

$
0
0

Hello all,

This is meant to inform Outlook developers about an issue in Outlook. If you know anything about the issue (say Office versions involved or any other details), don't hesitate to share your knowledge.

In a couple of minutes, I'll send a link to this topic to the Outlook team hoping they will be able to reproduce the issue and fix it. Anyway, I'll post the final result here.

So, an Add-in Express customer reported an issue that I reproduce using a VSTO add-in containing two meaningful parts:

1) it provides this Ribbon XML:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="ribbonLoaded_Callback" loadImage="getImages_Callback"><commands><command getEnabled="getEnabled_Callback" idMso="SaveAndClose" onAction="onSaveAndClose" /></commands></customUI>

2) it implements the onSaveAndClose method as follows:

public void onSaveAndClose(Office.IRibbonControl control, bool cnacelDefault)
{
    System.Windows.Forms.MessageBox.Show("!");
}

To reproduce the issue, you build the project, start Outlook (I use Version 1906 (Build 11727.20064 Click-to-Run), this is an Office Insider build), create a new appointment, and click the "Save and Close" button. Expected is: the onSaveAndClose method above is called. The issue is: the add-in doesn't receive that call.

To confirm that the add-in works correctly, use the "Quick Access Toolbar" or "Customize Ribbon" tabs of the Word Options dialog to add the "Save and Close" Ribbon command to the QAT or a custom ribbon group; find that Ribbon command in the "Commands Not in the ribbon" list. If you click the button added, the method above is called. This is the expected behavior.

I've captured a video; see the PowerPoint presentation at http://temp.add-in-express.com/support/Issues/Outlook/CannotInterceptClickingSaveAndCloseInOutlookAppointments.pptx. The test project is at http://temp.add-in-express.com/support/Issues/Outlook/OutlookAddIn4-InterceptingSaveAndCloseInAppointments.zip.


Regards from Belarus (GMT + 3),

Andrei Smolin
Add-in Express Team Leader

Please mark answers and useful posts to help other developers use the forums efficiently.


some emails have red circle with white line. What does it mean?

$
0
0

Hi,

I am level-2 support analyst.

One of the user has an issue with outlook emails. 

Email has red circle with white minus sign beside message preview. User is unable to view the message within client outlook. But able to view it in web version of outlook

What does this red circle with white minus line mean?

Please suggest.

Regards,

mahesh. G

Office.context.mailbox.getCallbackTokenAsync return blank token

$
0
0

Hello,

My add-in call Office.context.mailbox.getCallbackTokenAsync and result is succeeded but I get no token back.

{ "value": "", "status": "succeeded" }

Outlook 16.0.4849.1000

Exchange 15.0.1156.6

Thanks for your help

Query email signature from Office 365

$
0
0

Emails are generated via Graph API in a MVC Core web app I'm working on. Whoever the logged-in user is, the emails are sent through their Office 365 account. It even adds a record to their "Sent" folder. But what it does NOT do is include the user's signature in the email. I've been looking all over for a means to query for a user's Outlook email signature, but so far have come up empty. Looks like I can even query for their PICTURE, but I can't find a thing about their signature. 

Is there a means to acquire someone's email signature at runtime, if I already have their Active Directory basic info, such as their user Guid? 

Permission levels for shared calendars when reading with VBA

$
0
0

What permission level is required in shared Outlook/Exchange calendars in order to allow other users to read appointments from the shared calendar with VBA?

I'm having trouble getting this to work reliably. It appears the permission level must be granted to "view all details", otherwise (when "can view titles and locations" or lower) items are left out or access to the calendar is inaccessible.

In the UI, however, appointments can be seen by other users without problems - as expected.

When the permission level is elevated to "can view all details" all appointments are accessible immediately. But, however, when the permission level is lowered it takes some time for it to take effect. If the user sharing the calendar adds new appointments and other users remove and add it back to the "Shared Calendar" group, then it again becomes inaccessible with VBA.

Sub PrintSharedUserAppointments()
   Dim oOutlook As Outlook.Application
   Dim oOutlookNamespace As Outlook.Namespace
   Dim oOutlookRecipient As Outlook.Recipient
   Dim CalendarFolder As Outlook.MAPIFolder
   Dim oAppointmentItems As Outlook.Items
   Dim oAppointment As Outlook.AppointmentItem
  
   Set oOutlook = CreateObject("Outlook.Application")
   Set oOutlookNamespace = oOutlook.GetNamespace("MAPI")
   Set oOutlookRecipient = oOutlookNamespace.CreateRecipient("T2")
  
   oOutlookRecipient.Resolve
   If oOutlookRecipient.Resolved Then
      Set CalendarFolder = oOutlookNamespace.GetSharedDefaultFolder(oOutlookRecipient, 9)
      CalendarFolder.Display
      For Each oAppointment In CalendarFolder.Items
         Debug.Print oAppointment.Start, oAppointment.Subject
      Next
   End If
End Sub

Custom Contact Form layout

$
0
0
Hi. I am trying to change the backcolor in the advanced properties of the General tab in a custom Outlook contact form. The change shows in design mode, but after I republish the form and then open it to view, the change is gone. Can you tell me what would cause the change to not stick? Thanks!  Lisa

Create Add-in for Outlook Web

$
0
0

Hi Everyone,

I'm developing an Add-in for Outlook Web. I can create an Add-in in a screen of Appointment detail but I would like to create an Add-in in a screen of Calendar. Could you please share me the way to do this? Is it possible or not?

Thank you in advance.

Phong.

Outlook.Application objOutlook = new Outlook.Application()

$
0
0

Hi there,

My scenario is when I run the Outlook 2016 then I will save the unread mail as a MSG file. so I write some code to do it like the following sample:

// Creates a new Outlook Application instance
Outlook.Application objOutlook = new Outlook.Application();

// Creating a new Outlook message from the Outlook Application instance
Outlook.MailItem msgInterop = (Outlook.MailItem)(objOutlook.CreateItem(Outlook.OlItemType.olMailItem));

// Set recipient information
msgInterop.To = "to@domain.com";
msgInterop.CC = "cc@domain.com";

// Set the message subject
msgInterop.Subject = "Subject";

// Set some HTML text in the HTML body
msgInterop.HTMLBody = "<h3>HTML Heading 3</h3> <u>This is underlined text</u>";

// Save the MSG file in local disk
string strMsg = @"c:\\Temp\TestInterop.msg";
msgInterop.SaveAs(strMsg, Outlook.OlSaveAsType.olMSG);
I use the above sample code and got a error message 


Hi there, if you found my comment very helpful then please | Propose as answer | . Thanks and Regards.


AttachmentSelection may return 0 despite an attachment is selected in the UI

$
0
0

Hello All,

This post is meant to inform Outlook developers about an issue in Outlook. If you know anything about the issue (say Office versions involved or any other details), don't hesitate to share your knowledge.

I'm going to send a link to this topic to the Outlook team hoping they will be able to reproduce the issue and fix it. Anyway, I'll post the final result here.

So, an Add-in Express customer reported an issue that I reproduce using this VBA macro:

Sub dfdfgdf()
MsgBox ActiveExplorer.AttachmentSelection.Count
End Sub

In an Explorer window, you select an email with attachments. In this case AttachmentSelection.Count is zero; this is expected. In the Reading Pane, you click the drop down menu of an attachment and press {Esc} to close the dropdown menu. This selects the attachment. An indication of this is the Attachments context tab shown in the Ribbon. The issue is: AttachmentSelection.Count is still zero in this case.

A video showing the issue is inserted in the PowerPoint presentation at http://temp.add-in-express.com/support/Issues/Outlook/AttachmentSelectionReturnsZero.pptx.

In the real Outlook add-in, AttachmentSelection is obtained from the Click event of a custom Ribbon button added to the Attachments context tab.


Regards from Belarus (GMT + 3),

Andrei Smolin
Add-in Express Team Leader

Please mark answers and useful posts to help other developers use the forums efficiently.

Attachment size is not displayed after the EML file is converted to MSG. We are IConverterSession for conversion.

$
0
0

Hi,

Could someone help me how conversion of EML to MSG should be done to display the size of the attachment when the file is opened.

we are using IConverterSession  for conversion. 

MSG file in inbox does displays the size of the attachment but once it is converted the attachment size is lost.

MSG file from inbox: 

MSG file after conversion:

Thanks


thopulou Associate Software Engineer

Using Access VBA I cannot send email or text through outlook as of latest windows 10 update. Please help!

$
0
0

as of 10 days ago Access cannot send email or text using Outlook.  I get NO ERRORS (from Access VBA or from outlook) and I can see the messages in the "Sent Items" folder correctly.  Yet, nothing is truly going out! 

Normal emailing by using directly outlook (clicking on new email etc.) works fine

I am baffled!  Any insights would help

How to automate the process of importing a csv file into outlook calendar?

$
0
0

I would like to automate the process of importing a csv file into Outlook.  This would occur daily or weekly.

What I want to do is simple but after some research I did not find anything helpful so far,

basically, the csv file is based on employee's user name which can be matched to the user name at Active Directory,

Although my background is asp.net with C#, but other solution is also welcome. thanks a lot in advance.

Access violation exception in code sample outlook 2013 profile

$
0
0

I tried to create a project for the code sample at

https://blogs.msdn.microsoft.com/dvespa/2017/06/19/create-outlook-2013-profile-mapi-http/

I use the Visual Studio 2017 compiler patched at today.

I get

Unhandled exception at 0x011B1676 in CreateProfile.exe: 0xC0000005: Access violation reading location 0x8800041C.

at this line "& lpStoreProfSection)) || "

See below

line 214:     if (FAILED(hRes = GetStoreProvidersSection(
        lpSvcAdmin,
        (LPMAPIUID)lpSvcRows->aRow->lpProps[iSvcUID].Value.bin.lpb,
        & lpStoreProfSection)) ||
        (lpStoreProfSection == nullptr))
    {
        cout << "Error attempting to get the Store Providers Profile Section.";
        goto error;
    }


How to Migrate CategoryList from One PST file to Another via MAPI?

$
0
0

Hi,

I am trying to migrate the color category list from one PST file to another via MAPI & VC++.

I read the article at https://social.technet.microsoft.com/Forums/lync/en-US/f38edc75-f981-444e-bd27-d6627d663618/importing-a-master-category-list-between-users?forum=officeitproprevious . Based on that information, I try to use MAPI to read the hidden item with message class IPM.Configuration.CategoryList in the source PST file, then create a new associated message in the target PST file, then clone all the properties from the source message to the target message. Especially, I clone the contents of the property PR_ROAMING_XMLSTREAM.

However, after the that, when I try to open the target PST file, I cannot see the cloned color category list. Why?

Thanks 


Outlook.PropertyAccessor fails

$
0
0

I have an Outlook 2007 add-in built in VS 2008 which accesses some custom columns by selecting the correct folder, obtaining the first item and then using propertyAccessor.GetProperty(propertyID) to retrieve the value of the column for the item.

 

// This code is in the Addin_Startup

try

{

 mapi = mapiApp.GetNamspace(“MAPI”);

 folders = mapi.Folders;

 directory = folders[“My Folders”];

 folders = directory.Folders;

 myFolderInbox = folders[“Inbox”];

 items = myFolderInbox.Items;

 propertyID = GetColumnProp(myFolderInbox, HEADER);

}

catch

{

 // handle error

}

 

private string GetColumnProp(MAPIFolder mapiFolder, string propertyName)

{

 if (mapiFolder == null || string.IsNullOrEmpty(propertyName))

              return null;

 

 XElement folderView = XElement.Parse(mapiFolder.CurrentView.XML);

 var props = from Columns in folderView.Elements(“column”)

               where (string)Columns.Element(“heading” == propertyName

               select Columns.Element(“prop”);

 

 foreach (var prop in props)

               return prop.Value;

 

 return null;

}

 

 

then in the method which it is used:

for (int i = 1; i <= items.Count; i++)

{

 Outlook.MailItem mail = (Outlook.MailItem)items[i];

 Outlook.PropertyAccessor pa = mail.PropertyAccessor;

 

 try

 {

   string property = (string) pa.GetProperty(propertyID);

   // Do something with it depending on value.

 }

}

 

While this works fine in the development environment, when it is put on one of our test strings, it fails at the highlighted line. Does anyone have any ideas why this code might fail when I am simply setting an instance of the PropertyAccessor for an item? There is no error thrown. I have added logging statements, but at the pa = mail.PropertyAccessor line, the add-in simply exits. Nothing is logged after the line above it.


Delete Icon Move

$
0
0
Is there a way to move the icon to the right of the reading pane in Outlook (MS Office Professional Plus 2016) to move them to the left of the reading pane? In MS v10 Outlook move the Delete email icon to the far right if you have the reading pane open instead of it being at the email preview level.

FOLDER_IPM_INBOX_VALID is for which receive folder?

$
0
0

Hi,

For property PR_VALID_FOLDER_MASK, there is a flag FOLDER_IPM_INBOX_VALID indicate whether the IPM receive folder is valid or not.

However, based on GetReceiveFolder, there may be different receive folders for different message class. So FOLDER_IPM_INBOX_VALID is corresponding to which receive folder, the receive folder for message class IPM or IPM.Note?


Unable to delete appointment using the ical file in outlook desktop client

$
0
0
Hi Outlook Team, 

We have the following requirement.
1) We need to generate an appointment with recurrence pattern, and send it to attendees.
2) Later we need to update, delete single occurrence out of the recurrence pattern.
3) We may also need to delete the complete the recurrent appointment in some cases.

By delete, we mean the meeting should be marked as cancelled in the invitee's calendar.

We are sending the appointments via our web app sending an email to the attendees with .ICS file embedded in email. We are generating the email using Java Mail API and embedding the .ICS file as multipart message keeping the MIME type as text/calendar.

Our invitees are using Microsoft outlook Desktop Client, Office 365 Web client, gmail.

We are able to send the appointment with recurrence pattern, and also able to update the specific occurrence of the meeting. 

However we are facing difficulty with deleting the appointment or individual meeting specifically in the Outlook Desktop Client. When we send the delete event, in the invitee's mail box, it shows the button as "Remove from calendar" but doesn't mark the meeting as "cancelled" in the user calendar. The same is happening correctly in the Gmail web app.

I have tested it on the Outlook Version shown below

Office 365 MSO(16.0.11601.20184) 64 bit

I also tested a simple test case of creating a simple meeting using the below create.ics file(sending it as part of the mail) and then trying to delete the meeting using the delete.ics file below.

//create.ics
BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:India Standard Time
BEGIN:STANDARD
DTSTART:16010101T000000
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T000000
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER;CN=Test Sirion:MAILTO:xyz@abc.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Kapil Gupta:MAILTO:abc@xyz.com
DESCRIPTION;LANGUAGE=en-US:\n
UID:040000008200E00074C5B7101A82E00800000000908EB51F4E28D501000000000000000
 01000000000ED265B41C38B479A5315D1D23383D4
SUMMARY;LANGUAGE=en-US:New Meeting
DTSTART;TZID=India Standard Time:20190622T080000
DTEND;TZID=India Standard Time:20190622T083000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20190621T105648Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION;LANGUAGE=en-US:
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-OWNERAPPTID:-2091554845
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
X-MICROSOFT-LOCATIONS:[]
BEGIN:VALARM
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR


//delete.ics
BEGIN:VCALENDAR
METHOD:CANCEL
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:India Standard Time
BEGIN:STANDARD
DTSTART:16010101T000000
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T000000
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER;CN=Test Sirion:MAILTO:xyz@abc.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Kapil Gupta:MAILTO:abc@xyz.com
DESCRIPTION;LANGUAGE=en-US:\n
UID:040000008200E00074C5B7101A82E00800000000908EB51F4E28D501000000000000000
 01000000000ED265B41C38B479A5315D1D23383D4
SUMMARY;LANGUAGE=en-US:Canceled: New Meeting
DTSTART;TZID=India Standard Time:20190622T080000
DTEND;TZID=India Standard Time:20190622T083000
CLASS:PUBLIC
PRIORITY:1
DTSTAMP:20190621T110026Z
TRANSP:TRANSPARENT
STATUS:CANCELLED
SEQUENCE:1
LOCATION;LANGUAGE=en-US:
X-MICROSOFT-CDO-APPT-SEQUENCE:1
X-MICROSOFT-CDO-OWNERAPPTID:-2091554845
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-INTENDEDSTATUS:FREE
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:2
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT
END:VCALENDAR



Please let us know if there is any issue with the delete.ics file.

Please also put the code which we are using to send the mail in the below github gist, in case it is relevant. 

https://gist.github.com/kapilgupta101292/92769d3e9f8e6444cb9dde5960473b1e

I have already tested by adding the X-WR-RELCALID as suggested in the following Stack overflow link but that doesn't work either - 

stackoverflow =

https://stackoverflow.com/questions/356598/delete-calendar-event-using-icalendar-file-import-outlook-2003-problem

Please review the above ics file and let us know how to achieve the delete of the appointment. 
Please let us know if any input is required, we need to quickly resolve this issue to deliver our webapp.


How to check if current window is inline reply or normal reply?

$
0
0

Hi all,

I am developing Outlook VSTO add-in. 

Is there any way to check if user has inline reply window open or normal stand-alone reply window open?

My goal is..if the user has inline reply window open,

mailItem.Display(); 

will open the reply in stand alone reply and then

mailItem.Send(); will send the email, since there is no way to programmatically send inline reply.


Cant access Outlook PropertyAccessor

$
0
0

Hello everybody,

i'm creating an Outlook mail via VBA (Outlook 2016). Therefore i´m using the examples from the Microsoft documentation. The creation and display of the mail works properly. But i have to set a mail-header and so i'm trying to set a property through the PropertyAccessor.

Code:

Sub CreateEmail()
    Dim objOutlook
    Set objOutlook = CreateObject("Outlook.Application")
    Dim objMailItem
    Set objMailItem = objOutlook.CreateItem( 1 )
    objMailItem.Subject = "Test Subject"
    objMailItem.Location = "Test Location"
    Dim oPA
    Set oPA = objMailItem.PropertyAccessor 
    objMailItem.Display
End Sub

But i can´t access the PropertyAccessor. I´m getting a script error on the line:

Set oPA = objMailItem.PropertyAccessor

with no further information. Searching through this forum, i´ve found an older thread in which a user had the same problem which was caused by security policies (https://social.msdn.microsoft.com/Forums/office/en-US/c832a35b-e230-4e12-a2b5-bdddcff93521/outlookpropertyaccessor-fails?forum=outlookdev).

Has anybody an idea why i#m getting an error / which security policy is resbonsible for that?. 

Thank You
Stefan


Viewing all 6421 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>