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

How does WebEx added a button in the ribbon on Outlook for Mac?

$
0
0

I was wondering how this is possible:

WebEx integration with Outlook for Mac

Obviously it's not the new office.js API, is this made using AppleScript? Will such approach still work in Outlook 2016 for Mac?


Programmatically loop through all existing SENT ITEMS and copy to new folder

$
0
0

I want to open with the fact that I am not a programmer.

I'm looking to have a VSTO deployed through group policy to all users at my company. I need the VSTO to do a couple of steps:
1. Create a new folder called, "Old Sent Mail", if already exist ignore
2. Programmatically loop through all existing SENT ITEMS 
3. Copy Sent Items to a "Old Sent Mail". If sent mail has already been copied to new folder, it should ignore it. 
The program needs to be trigger each time Outlook has been restarted.


If someone is doing something similar to this, can you provide a copy of your code that I can work from? Thanks ahead of time for any help with this.

Outlook rules will not meet my needs because they are client-based rather than server-based. This is for retention purposes, because Sent Items are deleted after 180 days by Exchange administrators.

Outlook Javascript API - when in Outlook for Mac?

$
0
0

Hi,

I lastly read here:

https://dev.office.com/blogs/build2016release?utm_campaign=Build+2&utm_medium=bitly&utm_source=OneNote+Day+2

that the support for Office Apps using the office.js API will be available for Outlook for Mac, when can we expect this?

Include Original Text Message when AutoReply

$
0
0

I set an AutoReply rule using a template. The problem is that the reply does not add the original message. 

does anyone have an idea what script VBScript should i add in order to add the original message in the reply?

Tried with this, but it does not work

Sub AutoReply(Item As Outlook.MailItem)
    Dim olkReply As Outlook.MailItem
    Set olkReply = Item.Reply
    With olkReply
        'Change the subject on the next line as desired'
        .Subject = "Your Subject Goes Here"
        'Change the body as desired'
        .HTMLBody = "Your reply text goes here.<bt><br>" & olkReply.HTMLBody
        .Send
    End With
    Set olkReply = Nothing
End Sub

Thank you! 


How to get the email address from a outlook reporting item body

$
0
0

Hi Guys,

I have a small question. I am tracking the outlook inbox folder and I want to get the email address for all the received emails. For emails of the type mail my app works perfectly in C#.net. But when there is a outlook report item like a undeliverable mail message with all the undeliverable recipient names on the body I am unable to get the name and email from this email body.

I also cant find a method to get this.

Could some one please help me on this.

Thanks

Lucki

Not able to read Sender Infromation from c# code :: Getting Unspecified error (Exception from HRESULT: 0x80004004 (E_Abort))

$
0
0

Hi,

My aim is to read basic information like sender Name, email address from outlook mail item for that I created one console application. Blow basic code I used for that.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Outlook;

namespace MAPI
{
    class Program
    {
        static void Main(string[] args)
        {


            string lblSubject, txtBody, lblSenderName, lblSenderEmail;
             List<string> litems = new List<string>();

            try
            {
                Microsoft.Office.Interop.Outlook.Application myApp = new Microsoft.Office.Interop.Outlook.ApplicationClass();
                Microsoft.Office.Interop.Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");
                Microsoft.Office.Interop.Outlook.MAPIFolder myInbox = mapiNameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);
                if (myInbox.Items.Count > 0)
                {

                    lblSubject = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[1]).Subject;


                    litems.Add(lblSubject);

                    txtBody = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[1]).Body;
                    litems.Add(txtBody);

                    lblSenderName = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[1]).SenderName;
                    litems.Add(lblSenderName);

                    lblSenderEmail = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[1]).SenderEmailAddress;
                    litems.Add(lblSenderEmail);


                    Console.WriteLine(lblSubject +  "," + txtBody + "," + lblSenderName + "," + lblSenderEmail);

                }
                else
                {
                    Console.WriteLine("There are no emails in your Inbox.");
                }
            }
            catch (System.Exception ex)
            {
                foreach(string item in litems)
                {
                    Console.Write(item);
                }

                Console.WriteLine(ex.Message);
            }
            finally
            {
                Console.ReadLine();
            }

        }
    }
}

Above code target build is x86 machines.

I'm not able to read the information what I'm expected from my code, getting error in outlook 2010 in few machines.

Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

and in few machines

Unspecified error (Operation aborted from HRESULT: 0x80004004(E_Abort))

I hope my code is perfect because, I can able to get same information from different exchange server as well different outlook version say 2013, 2016 with the same code.

System specifications where I'm getting error:

Outlook 2010

Windows 7 64 bit

McAfee End point protection (its protecting outlook emails also I think - not having permissions to change settings here )

Some group policies are applied on same machine

And I'm having complete rights(Admin) on my machine

Can you please help which one blocking me to get those details or any code  changes needed ??

Or any settings in outlook 2010 client need to be changed?? or McAfee having any special setting to block reading of outlook mailsprogrammatically?? or Is there any chance to block programatic reading of outlook items using group policy??

Is there any permissions at exchange server level which blocking me?? (exchange sever 2003 - patch applied to support 2010)

Please Help me out from this issue. YOUR HELP SHOULD BE MUCH APPRICIATED.

Feel free to ask any other information needed for you to sortout this issue.

Thanks,

Adithya.

Integrating IM applications with outlook 2010/2013

$
0
0
I have implemented the IM application (name is "ContactCardDesktop.exe") as suggested by the link/article "Integrating IM applications with Office" https://msdn.microsoft.com/en-us/library/office/jj900715(v=office.15).aspx I have done all the registry setting per the article. but there is no call from outlook to IM application for function GetAuthenticationInfo() and GetInterface(). Even not getting the ProcessID at registry location HKCU\Software\IM Providers\ContactCardDesktop.

In outlook logs I am getting errors attached below. I have gone through to many suggestion but didn't get help much. Please suggest the problem/solution.

Sample code for Application.

[ClassInterface(ClassInterfaceType.None)]
    [ComSourceInterfaces(typeof(_IUCOfficeIntegrationEvents))]
    [ProgId("LitwareClientAppObject.Class")]
    [Guid("449B04AD-32A8-4D21-B0AE-8FC316E051CE"), ComVisible(true)]

    public partial class LitwareClientAppObject : IUCOfficeIntegration
    {
        IMClient imClient;
        Automation imAutomation;

        public LitwareClientAppObject()
        {
            InitializeComponent();
            imClient = new IMClient();
            imAutomation = new IMClientAutomation();
        }
        // Implementation details omitted.
        public string GetAuthenticationInfo(string _version)
        {
            string supportedOfficeVersion = "15.0.0.0";
            // Do a simple check for equivalency.
            if (supportedOfficeVersion == _version)
            {
                return "<authenticationinfo>";
            }
            else
            {
                return null;
            }
        }

        public object GetInterface(string _version, OIInterface _interface)
        {
            IMClient imClient = new IMClient();
            IMClientAutomation imAutomation = new IMClientAutomation();
            switch (_interface)
            {
                case OIInterface.oiInterfaceILyncClient:
                    {
                        return imClient;
                    }
                case OIInterface.oiInterfaceIAutomation:
                    {
                        return imAutomation;
                    }
                default:
                    {
                        throw new NotImplementedException();
                    }
            }
        }

        public OIFeature GetSupportedFeatures(string _version)
        {
            OIFeature supportedFeature1 = OIFeature.oiFeatureQuickContacts;
            OIFeature supportedFeature2 = OIFeature.oiFeatureFastSearch;

            return (supportedFeature1 | supportedFeature2);
        }
Errors like:

CMsoIMProviderFactory::HrEnsureDefaultIMAppRegKeys Succeeded opening reg key (HKCU:SOFTWARE\IM Providers)
CMsoIMProviderFactory::HrEnsureDefaultIMAppRegKeys Succeeded querying reg key (HKCU:SOFTWARE\IM Providers:DefaultIMApp:ContactCardDesktop)
CMsoIMProviderFactory::HrEnsureDefaultIMProcessRegKey Succeeded opening reg key (HKCU:SOFTWARE\IM Providers\ContactCardDesktop)
CMsoIMProviderFactory::HrEnsureDefaultIMProcessRegKey Succeeded opening reg key (HKLM:SOFTWARE\IM Providers\ContactCardDesktop)
CMsoIMProviderFactory::WhichMessengerInProcessList Using (ContactCardDesktop.exe) process name for search

CMsoIMProviderFactory::WhichMessengerInProcessList Using (ContactCardDesktop.exe) process name for search hr = 80040154, We couldn't identify the provider type we now try to manually CoCreate using the LCClient CLSID
CMsoIMProviderFactory::HrGetAvailableProvider !failed! Line: 409 hr = 0x80040154 hr = 80040154, We couldn't identify the provider type we now try to manually CoCreate using the LCClient CLSID
CMsoIMProviderFactory::HrGetAvailableProvider !failed! Line: 289 hr = 0x80004005 !!!Provider Initialization Failed!!!

ItemChange Fires Multiple Times on a Change

$
0
0

[Using Outlook Professional 2013] 
[OutlookSpy being used to track events]

We have an Add-In that updates a database when an Outlook Appointment has been updated.

The issue is that when you make a change, the ItemChange event fires multiple times.   What this means for us is that a single change will trigger Multiple updates to our database with the same exact information; a waste.

Maybe the ItemChange event handler is the wrong place to update my database.  Any suggestions?

RECREATE

1. Create an Appointment in your Calendar.
2. Right Click on that Appointment / Select "Categorize" / Select a Category

The following Appointment events are fired
PropertyChange (Categories)
Write (false)
BeforeCheckNames (false)
AfterWrite ()
<Unknown(DispID=0x0000FC95)> (false)

The following Items events are fired
ItemChange (IDispatch)
ItemChange (IDispatch)
ItemChange (IDispatch)


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.


Outlook privacy meeting pop up

$
0
0
Is there a way to create a pop-up when you send a meeting invite that asks "Did you mark this meeting as private?"

Customising the text in a Meeting Request

$
0
0

In Outlook, is it possible to change the text that appears when a user clicks on a New Skype for Business request?

This has to be VSTO based solution. 

Ideally I would like that when they click on the New Skype for Business meeting I change the default link that's put in and replace it with some customised text and code that pulls out the Conference Id from PSTN.

Or, is there a better way to achieve this?

Thanks for any help anyone can be.

Dave

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

Excel Sending Email via VBA - Suppressing the Warnings

$
0
0

Hello everybody,

I would be very appreciative if someone more knowledgeable than would help me out. I am building a VBA code in Excel that will send an Excel File as an attachment in an email to somebody using Outlook. I can get everything to work just fine except that a warning message pops up and it is quite irritation and negates the usefulness of the macro if I have to constantly click on [Allow].

Any help with how to suppress the warning messages would be greatly appreciated! 

Note: My company's IT will not let me download add-ins or programs not on their "safe" list.

Also, I have included the important parts of my code below.

Thanks!

Eric

--------------------------------------------------------------------------------------

    

Sub Email_Finance()

    Dim oApp As Object
    Dim oMail As Object
    Dim WB As Workbook
    Dim FileName As String
    Dim wSht As Worksheet
    Dim shtName As String
    Dim wsTab As Worksheet

    Application.ScreenUpdating = False
    Application.DisplayAlerts = False

    ' The section below goes to Outlook to create an email, fill in some details, and then emails it out.

    Set oApp = CreateObject("Outlook.Application")
    Set oMail = oApp.CreateItem(0)
    With oMail

        ' Uncomment the line below to hard code a recipient

        .To = "Eric@domain.com"
        .Cc = "Eric@domain.com"

        ' Uncomment the line below to hard code a subject

        .Subject = "G&A Monthly Report - Finance"

        ' Uncomment the lines below to hard code a body

        .body = "Dear Eric," & vbCrLf & vbCrLf & _
          "Please find attached the G&A report for this month. Please review and adjust accordingly. " & vbCrLf & vbCrLf & _
          "Thanks, Eric"
        .Attachments.Add WB.FullName
        .Display
        .Send
    End With

Search Outlook email with Excel VBA

$
0
0

Hi everyone,

I have the below code which works perfectly in Outlook but I need to launch it from Excel VBA and I cannot seem to be able to get it to run. My biggest problem is with the variables since Excel VBA would not accept anything along the lines of Dim x As Outlook.Namespace or Outlook.Mailitem.

Any ideas on how to solve this? I would very much appreciate any suggestions.

Thank you,

Alex

Sub NEW_JULY()

    Dim olApp As Outlook.Application
    Dim olNs As NameSpace
    Dim Fldr As MAPIFolder
    Dim olMail As Variant
    Dim i As Integer

    Set olApp = New Outlook.Application
    Set olNs = olApp.GetNamespace("MAPI")
    Set Fldr = olNs.GetDefaultFolder(olFolderInbox)
    i = 1

   For Each olMail In Fldr.Items
        If InStr(olMail.Subject, "MACRO VAX 48634 REPORT") <> 0 Then
        olMail.Display
        i = i + 1
        End If
    Next olMail

End Sub

Read static subfolders content in outlook using vb.net

$
0
0

Hi All,

when i was click on outlook addin button and read outlook mapi olfolders like inbox,outbox,drafts,sent items etc is fine.. but  create some static folders like "folder1","folder2" . i am unable to handles read the folder1,folder2 data. please suggest how can i read the static folder content using vb.net

Thanks In Adv

Arun.


Email Name Personalization in Outlook

$
0
0

There is another problem i have. Is there are way that i personalize my email in outlook. I have several clients and as the new year comes i need to send a christmas card to all of them. I do not want to send the emails one by one and at the same time i want to avoid using Dear Sir, Dear client, Dear all etc. I wondered if there is a way that i add all the contacts in the BCC and use saomething like Dear {Name} , which would replace {Name) with the one from my contact list.

How to add conditon for Enable/Disable (ON/OFF) on Customized ribbon button on Outlook???

$
0
0
I have added one button on outlook Home tab.Now I want to give a condition for Enable/Disable on clicking that particular button.I have written code in c++ based on this linkhttps://social.msdn.microsoft.com/Forums/office/en-US/220815a2-0ccf-4ee3-b6e4-f2a33e5563df/confused-over-getenabled-for-ribbon?forum=accessdev. But unable to find interface for Ribbon control,so code is not working

Share email categories across team

$
0
0

Hi All,

Is there any way to share categories across my team. Usually when our team receives an email, everybody gets the same email. So if i mark an email with particular category, is it possible to make it reflect in everybody's inbox?

Is there any add-on for doing similar thing.

Basically we want to know who started working on which email.

Thanks.


Please specify your SQL Server version while posting questions
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue

MAPI API OpenStreamOnFile not working properly

$
0
0

My machine is windows 7 32 bit, outlook 2010 32 bit. I am writing outlook plugin which will replace the existing outlook extension. I am using existing MAPI code in outlook plugin.I am using OpenStreamOnFile function to create a file stream which will write the mail content to the created file. I am using the below code

// Open the output stream

hRetCode = OpenStreamOnFile(MAPIAllocateBuffer, MAPIFreeBuffer, STGM_CREATE | STGM_READWRITE, (LPTSTR)lpszFileName, NULL, &pStreamFile);

ULONG n;

hRetCode = pStreamFile->Write(_T("sdfsfsdf"),9,&n); //test purpose

 

Anybody please help me on this issue.

OpenStreamOnFile function returing S_OK, file is also there in the specified location and pStreamFile write function is also returning S_OK. But the content is not there in the file.

VBA Collapse a folder in outlook navigation pane

$
0
0

I have 4 accounts in my navigation pane with hundreds of folders. To reset the views to a fresh start, I would like to go to a top level folder and collapse it programmatically. Using VBA, I could have one button that did all 4 accounts.

I see some expand-all macros on-line, but I don't see a why to collapse a folder's sub-folders.

Help would be appreciated. Thanks, Ted

Viewing all 6421 articles
Browse latest View live


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