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

How to access Outlook Appointment item from Custom Task Pane

$
0
0

I am using VSTO to create a plugin for outlook. I am able to add custom task pane in appointment window. Custom task pane window has a dropdown list. I want to update the text in appointment body after user change the selected item in dropdown list.

I am not able to figure out how to access the appointment object from custom task pane.

Dim inspector As Outlook.Inspector =   ???    

Dim apptItem As Outlook.AppointmentItem = TryCast(inspector.CurrentItem, Outlook.AppointmentItem)


Any help would be much appreciated.

Many thanks in advance.



Sample Outlook presence provider app

$
0
0

I see lot of developers looking for a way to provide outlook presence integration so I want to develop a sample app and provide that sample back to developer community for a reference.

I started reading from Microsoft provided help page (https://msdn.microsoft.com/en-us/library/office/jj900715.aspx). That page provides lot of info but following that page does not provide complete working app. Infect that page does not even mention that for this solution we will need an out of process COM server.

After digging into other forums, I finally realized that I need an out of process COM server so I found one more Microsoft sample to create out of process COM server, then registered COM and started my sample app.

At this point, my sample app is very basic and just host UCCollaborationLib.IUCOfficeIntegration and UCCollaborationLib._IUCOfficeIntegrationEvents interfaces and creates the IMprovider registry mentioned in Microsoft document. I want to first Outlook 2016 to call one of the function from IUCOfficeIntegration interface and then implement full working sample but outlook does not call any function of COM. I tried to create VB script to call GetAuthenticationInfo and that works fine so I don't know what is my sample app is missing which outlook needs in order to this integration work.

In next post I will attach my non working sample so incase someone want to look into code.


MAPI works in Visual Studio only

$
0
0

Hi,

I encounter a very strange problem. I have a program that will create a PST file and then add some folders and items into it.

If I debug the program in Visual C++(VS 2008), then everything is OK.

But if I run the debug verson outside Visual C++, then only the PST file can be created. The folders and items cannot be added, even though the functions return successful values. I try to run the debug version as administrator, but still fails.

My OS: Windows 7(32bit)

My Outlook version: Outlook 2010(32bit)

What is the problem?

Thanks


How to track the uninstall data of an outlook add-in published in MSOffice Store.

$
0
0
Our add-in for outlook 2013 is available on MS Store.  When a user installs the add-in, our database is able to records the new user.  We are unable to track/record if or when an end user uninstalls the add-in. MSOffice store support say there is not a way to do this.  And suggested we try the forum.  Does anyone have an idea of how we could record when a user uninstalls (switches off) an Outlook add-in that was installed via the Office store? 

Get data Exchange server conection status

$
0
0

Hi, 

I need to get data with a add-in of outlook for get data the next dialog of outlook. 

It's posible ? 


Thanks. 

How to save message in the inbox into the same folder of another message shown on (conversation view mode) outlook 2016

$
0
0

How to save message in the inbox into the same folder of another message shown on (conversation view mode) outlook 2016

Dears

I am using office 2013 or 2016

If I am filtering the inbox by date and using (conversion view)

When a new message arrives, I can see it in the inbox, and see old emails (previously saved in other folders,let's call them XXXX or YYY)

All in teh same conversation

now I need to move the new message arrived into the one of teh other folders (say XXX or YYY) 

but I want to avoid

1- drag and drop from inbox pane to folder pane (i need to scroll and hover over all folders)

2- using the right click on message , then form the menu is select, move to other folder, then i start rolling from folder window

Hint: Using rules is not helping in this regard

I prefer to select the new message (in the Inbox, not yet directed to any folder) and the older message (already in a folder XXX or YYY)

and then click in something like (it can be in the right click , or even a macro with icon)

(Save in same folder) or

(merge in folder)

(move to same folder)

which does not exist under all commands or rules or any other way

What i need help with is:

  1. If a Macro is the solution, can you provide me with this macro, then I can copy/paste it and apply
  2. or tell me better option, that may exist somewhere but i do not know 
  3. If you go to the online version of outlook, on office 365, there is an option of (searching the folder) under move email to, so i can write the first 3 letters of a folder, it is faster to find, but on the desk top outlook 2013, and 2016 this function is not there, this is a sample of solution but the online outlook 365 is very slow compered with the desktop version of outlook 2013 or 2016

Regards

How to save message in the inbox into the same folder of another message shown on (conversation view mode) outlook 2016

$
0
0

How to save message in the inbox into the same folder of another message shown on (conversation view mode) outlook 2016

Dears

I am using office 2013 or 2016

If I am filtering the inbox by date and using (conversion view)

When a new message arrives, I can see it in the inbox, and see old emails (previously saved in other folders,let's call them XXXX or YYY)

All in teh same conversation

now I need to move the new message arrived into the one of teh other folders (say XXX or YYY) 

but I want to avoid

1- drag and drop from inbox pane to folder pane (i need to scroll and hover over all folders)

2- using the right click on message , then form the menu is select, move to other folder, then i start rolling from folder window

Hint: Using rules is not helping in this regard

I prefer to select the new message (in the Inbox, not yet directed to any folder) and the older message (already in a folder XXX or YYY)

and then click in something like (it can be in the right click , or even a macro with icon)

(Save in same folder) or

(merge in folder)

(move to same folder)

which does not exist under all commands or rules or any other way

What i need help with is:

  1. If a Macro is the solution, can you provide me with this macro, then I can copy/paste it and apply
  2. or tell me better option, that may exist somewhere but i do not know 
  3. If you go to the online version of outlook, on office 365, there is an option of (searching the folder) under move email to, so i can write the first 3 letters of a folder, it is faster to find, but on the desk top outlook 2013, and 2016 this function is not there, this is a sample of solution but the online outlook 365 is very slow compered with the desktop version of outlook 2013 or 2016

Regards

Outlook 2016 problem when getting GetRecurrencePattern().RecurrenceType while Reading Pane is open

$
0
0

Create a recurrent task and close it. Make sure the Reading pane is visible - say, you can choose the Today view. Select the task item and execute the following VBA macro (put it in a standard module in the VBA IDE):

Public Sub ExplorerJob()
Dim anItem As Outlook.TaskItem
Set anItem = Application.ActiveExplorer().Selection.Item(1)
Debug.Print anItem.GetRecurrencePattern().RecurrenceType
End Sub

While in the VBA IDE, open the Immediate window to see the value the macro prints. Note the value. In the Outlook UI, you may create a button calling the macro on the QAT.

Now, when the task is selected, open it and change the recurrence pattern; specifically, change the recurrence type: choose between Daily, Weekly, Monthly, or Yearly. Press the Save & Close button. Now call the macro above. You'll find that the value it prints doesn't change. Change the recurrence type once again and let the macro print the recurrence type: it doesn't change.

I use Outlook 2016 32bit build 16.0.7426.1015. I can also reproduce the issue in Outlook 2016 64bit.

I can provide extra info if required.


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.


Cancelling ITEM_OPEN causes Outlook Appcrash (Possible bug?)

$
0
0

In lieu of a Bugtracker I have to write here, but i think this is a possible Bug introduced by updates:

I am writing an office addin using c# and Microsoft.Interop libraries. When I cancel the opening of an appointment via setting the Cancel bool to false in the Item_Open event causes outlook to crash with an Appcrash when opening an appointment of a recurring series with attendees. This is somewhat new, in 2010 and 2013 it used to work.

Has anyone any idea how to get this working in 2016?

I tried to identify the problem in my code but even the example for the Inspector Wrappers (Which also works for 2016 in other regards) breaks if i just set cancel to true in the AppointmentItem open event

Outlook 2010 show this item contains active content that cannot be displayed in preview panel.

$
0
0
Hello guys,

I wrote a custom form in outlook 2010 that for reprocessing message.  When I focused on an email the preview panel showed "this item contains active content that cannot be displayed". But When I double click email and open a new message form everything is ok.

I supposed does any group policy or outlook settings disabled this action?

help me!

Best Regards,
Sue.

Einstein Su

Addin not installing after the install process.

$
0
0
I created an add-in for Outlook 2013. The OS I am developing on is Windows 10. The test computer is Windows 8. The problem is in the past the setup MSI worked. We would copy the msi to the target computer, no problem. For some reason I copied the msi to the target computer installed it but it does not show up in Outlook menu: File\options\Add-ins.  On my development computer it all work just fine. Any ideas about what the problem could be? Anyone can tell where I can fine the step to deploying an add-in the people I work with are not forth coming with that info.

OFFICE 2011 email subject script

$
0
0

Hello- I am looking for an email subject script for Office 2011 for mac v 14.6.5. We use a job management application that sends out tasks to your email with the genericsubject line that reads "You have been given the following assignments". The body of the email always has in thethird line the Job Number and Name.

So, we have the outlook rule that looks for the generic subject line and upon finding it... runs a script that replaces the subject with the third line of that same email's body.

Any help on writing the script that would do would be amazing!

outlook cann't open an assigned task

$
0
0

1.question description

User A assigned a task to user B;When user B try to opened it, outlook errored "Sorry, we're having trouble opening this item. This could be temporary, but if you see it again you might want to restart Outlook. Outlook cannot perform this action on this type of attachment."

2.detail

OS:win7 64 bit;outlook 2013 32bit

User A's outlook deployed a plug-in, and the plug-in was developped with MAPI.

3.addtion

When i disabled the code blow in the plug-in, User B can open the task sent by user A using the new plug-in.

the disabled code:

#if 0

   CComPtr<Outlook::_TaskItem> spCurTaskItem = 0;
   hr = lpDisp->QueryInterface( Outlook::IID__TaskItem , (void**)&spCurTaskItem);
   if(SUCCEEDED(hr) && spCurTaskItem)
   {
    hr = spCurTaskItem->Save(  ) ;
    return hr ;
   }
   
#endif



The reminder for "xxxx" will not appear because the item is in a folder that doesn't support reminders. Is this Ok?

$
0
0

I use VB.NET to create task in Outlook 2013. 

If a task has reminder, Outlook prompts

"The reminder for "xxxx" will not appear because the item is in a folder that doesn't support reminders. Is this Ok?"

However, on the same folder, if I create a task with reminder from Outlook, I don't have this warning.

How to avoid such warning when creating task from VB.NET?

I would appreciate it if anyone could give me some ideas.

Regards,

Cowcow

Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT)) - outlook appointment

$
0
0

Hi

I am creating program to send the holiday date of staff  from sqlserver  table  to outlook calendar and I written the sample code. But when I run the code  and if no outlook is not open the error is coming  as given below

Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT)). How I can get rid of this error and make an appointmtent even if the outlook is not open.

private void button1_Click(object sender, EventArgs e)
        {

Microsoft.Office.Interop.Outlook.Application app = null;
            Microsoft.Office.Interop.Outlook.AppointmentItem appt = null;

            app = new Microsoft.Office.Interop.Outlook.Application();

            appt = (Microsoft.Office.Interop.Outlook.AppointmentItem)app
                .CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem);
            appt.Subject = "Meeting ";
            appt.Body = "Test Appointment body";
            appt.Location = "TBD";
            appt.Start = Convert.ToDateTime("11/11/2016 05:00:00 PM");
            appt.Recipients.Add("test@company.com");
            appt.End = Convert.ToDateTime("12/11/2016 6:00:00 PM");
            appt.ReminderSet = true;
            appt.ReminderMinutesBeforeStart = 15;
            appt.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh;
            appt.BusyStatus = Microsoft.Office.Interop.Outlook.OlBusyStatus.olBusy;
            appt.Save();
            appt.Send();

}


polachan


Mail From Excel Using Outlook Error

$
0
0

Hello All,

I am encountering an error on a system that I ported a Mail from Excel using Outlook program I wrote while reading an oMailItem property (.body).  This is confusing, because I can write to the property but cannot read from it which, as far as errors go, seems backwards.  I'm putting this out there for input but I believe this is an Office Macro Security setting issue which is managed by my IT department.

Below is the offending procedure.  The error occurs when the sDefaultSignature variable attempts to read the oMailItem.Body property.  This is done as a means to capture the user's default Outlook signature and use that instead of an alternate one that is defined in the Excel workbook.  Perhaps there is another way to do that?

Excuse the verbosity of some of the comments; this procedure is also used as a VBA training aid.

Sub WriteMail(sToRecipients, sCCRecipients, sBCCRecipients, sBody, sSubject, sDefaultSignature) 'Sub opens a new mail message in outlook and builds

'out the contents based on user input. 'Late Binding (Best for Distribution/Compatibility) Dim oOutlook, oMailItem As Object Set oOutlook = CreateObject("Outlook.Application") Set oMailItem = oOutlook.CreateItem(olMailItem) 'Early Binding (Best for Programming) 'Dim oOutlook As Outlook.Application 'Dim oMailItem As Outlook.MailItem 'Set oOutlook = New Outlook.Application 'Set oMailItem = oOutlook.CreateItem(olMailItem) With oMailItem 'Add Recipients .TO = sToRecipients .CC = sCCRecipients .BCC = sBCCRecipients On Error Resume Next .Recipients.ResolveAll 'May cause error depending on
'security settings. Formats all e-mail
'addresses as valid "mailto:" items. 'Set Subject .Subject = sSubject 'Mail Body Format .BodyFormat = olFormatHTML '(HTML = 2) 'Change Default Signature Block Prior to Sending Body as it would be
'overwritten if User Opt'd to use their Default Outlook Sig.
If UFrm_Email.CBox_ApplyUserSig = True Then On Error GoTo SignatureError: sDefaultSignature = .Body 'Throws an error depending on
'security settings. End If Continue1: 'Apply Template Text and Chosen Signature .Body = sBody & vbCrLf & vbCrLf & sDefaultSignature 'Set Reply-To Recipients On Error GoTo ReplyToError: .ReplyRecipients.Add Range("Config_AlternateReplyTo") 'This can
'cause an error
'depending on
'security settings. Continue2: 'Display Message .Display 'Send E-Mail Automatically (Disabled) '.Send End With 'This procedure is done. Destroy all objects to clear memory. Set oMailItem = Nothing Set oOutlook = Nothing Exit Sub 'If this is not here then the procedure will execute the error
'handlers below even if there isn't an error! 'Error Handling SignatureError: MsgBox "Unable to apply user's default signature." & vbCrLf & _
vbCrLf & "This is likely due to Excel's current Macro " & _
Security Settings.", vbOKOnly, "Error" Resume Continue1 ReplyToError: MsgBox "Unable to apply alternate 'Reply To' address." & vbCrLf & _
vbCrLf & "This is likely due to Excel's current Macro " & _
Security Settings.", vbOKOnly, "Error" Resume Continue2 End Sub




How to save a MailItem as ReadOnly or looks like a Sent Item?

$
0
0

Is there a way to mark the MailItem read only and/or lock it to be not editable?

Right now when I make a copy of an existing MailItem, save it somewhere (ex: c:\helloworld.msg) and then programmatically opens it, it will open in editable mode, all the TO, CC, fields are editable. I want to make it so that it looks like a normal email that you received.

Only Sending 6 emails and then message is coming your limit exceeded. how to send the email as que. Please help

$
0
0

Hi

My code is as follows

 foreach (DataRow row in dt.Rows)
  {

MailMessage depotmsg = new MailMessage();
                string FromMail = GetValueFromINI("FromEmail");
                depotmsg.From = new MailAddress(FromMail, "myname");
                depotmsg.Subject = "Expiry date reminder";
                depotmsg.To.Add(new MailAddress(_email, _depotname));
                depotmsg.IsBodyHtml = true;
                SmtpClient client = new SmtpClient();
                client.UseDefaultCredentials = false;
                client.Credentials = new System.Net.NetworkCredential(username, PassWord);
                string port = GetValueFromINI("Port");
                client.Port = Convert.ToInt32(port); // You can use Port 25 if 587 is blocked (mine is!)
                string host = GetValueFromINI("Host");
                client.Host = host;            

                client.EnableSsl = false;
                string htmlString = getHtml(newDS);
                depotmsg.Body = htmlString;

                try
                {
                  client.DeliveryMethod = SmtpDeliveryMethod.Network;
                   // client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
                   // client.PickupDirectoryLocation = @"E:\temp\email";
                    client.Send(depotmsg);

                    
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Not Send ");
                }
  }

While running the  program , the error message " The server response was: 4.4.2 Message submission rate for this client has exceeded the configured limit ."

But while debugging the program  all the email  will go without error message. I used the following method 

client.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
client.PickupDirectoryLocation = @"E:\temp\email";

But  after that,  no error is coming but the mail not sending from E:\temp\email . 

Why all mail going fine while debugging  but error message is coming while running exe . What is the solution for that.

Is it good solution to give the code to  wait for a few second after sending each mail please anybody can advise me.

Please help with a solution, it would be very appreciate.

Regards



polachan

How to access required sub folder directly over thousands of sub-folders?

$
0
0

Hi,


I'm working on project, basically which fetches mails from outlook sub-folders and will do some business required things.


Shared mailbox (say Public folders) having a deeply nested sub-folders, mailbox containing more than two thousand sub-folders. Here I'm able to find required sub-folder by navigate through all.Everytime its taking almost 5-10 mins to find the one which I want.


Is there any way to access (in vb.net or c#) required sub-folder directly or if someone having piece of code to access share with please.


FYI, I'm having full sub-folder path with me and it won't get changed also.

Thanks,

A.

How Can I Enumerate the Categories for a Shared Inbox?

$
0
0

I can easily get the Categories in Outlook for the default inbox using this: https://msdn.microsoft.com/en-us/library/ff424467.aspx.

However, I have been unable to figure out how to accomplish this for a shared inbox. Is it possible to enumerate the categories for a shared inbox? 

Viewing all 6421 articles
Browse latest View live


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