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

How to avoid Select Profile PopUp that comes when creating Outlook.Application object ?

$
0
0

Hi all,

          I am using Outlook Object library for Getting Items within PST file.When ever i am trying to create Outlook.Application

Outlook internally prompting a select profile popup in multi profile Configured  outlook .I handled this scenario by editing registry value that found in @"Software\Microsoft\Exchange\Client\Options\PickLogonProfile to 0. But one of my friend told me registry change is not right thing to do. I also used namespace.Logon methos but still issue persist. Is there any other way to handle the scenario ? please advice.

Thanks

***Hemant    


H.S.Navarkar


Outlook Addin inactive after outlook startup

$
0
0

Hi

We are experiencing a strange issue with a VSTO outlook addin that works fine after installation however after a user logs out and logs back in again the addin becomes inactive. When I attempt to activate the plugin I can see an error

Load Behavour: Not loaded. A runtime error occured during the loading of the COM add-in.

The addin is located on the c:\

It can be installed/ uninstalled by a user

I have since enabled debugging on the VSTO and have been given the following output -See Below

The only way to temporarily fix the addin is to uninstall and reinstall.

Can anyone see why this addin is not working?

Many thanks,

Matt

Could not load file or assembly 'Outlook2010donorflexAddIn1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2071c7c802c0dd82' or one of its dependencies. The system cannot find the file specified.


************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'Outlook2010donorflexAddIn1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2071c7c802c0dd82' or one of its dependencies. The system cannot find the file specified.
File name: 'Outlook2010donorflexAddIn1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2071c7c802c0dd82'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.CreateEntryPoint(String entryPointTypeName)
   at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.ExecuteCustomization.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IExecuteCustomization2.LoadEntryPoints(IntPtr serviceProvider)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Outlook 2013 Context Menu on Email Address

$
0
0

I would like to add a menu item to the context menu that appears when right clicking an email address in the reading pane. Is this possible?

 <contextMenu idMso="??">
      <button id="btnREAD_CreateEmailAssociation" onAction="HandleRibbonClicks" label="Associate with Entity" getImage="getRibbonImage" />
    </contextMenu>

If so, how do I get the value of the email address so that I can pass it to "HandleRibbonClicks"? What is the Office.IRibbonControl passed?

I've tried using ContextMenuContactCardRecipient and ContextMenuContactCardSender but the menu still won't show up.



Is it possible to capture the Outlook client startup or close event?

$
0
0

I am try to capture the item add/change/delete event using VB.NET

It works fine with the following code:

  Private Sub SetOutlookEvents()
       
        Dim notes As Outlook.Items = comm.oAppNS().Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderNotes).Items
        AddHandler notes.ItemAdd, AddressOf ItemAddNote
        AddHandler notes.ItemChange, AddressOf ItemChangeNote
        AddHandler notes.ItemRemove, AddressOf ItemRemove
       
    End Sub

However, if I close the Outlook client and open it again, the events are not fired anymore.

Is it possible to capture the Outlook startup event so that I can call my "SetOutlookEvents" to add the handler again when user start the Outlook client?

Regards,

CowCow

Use ribbon library with Outlook

$
0
0

I'm writing an addin for Outlook, Excel and Word.

I created a ribbon library as described: Sharing a Ribbon Customization Between Office Projects in Visual Studio 2010 (McLean Schofield)

This solution works perfect with Excel and Word, but failed on Outlook.  On Outlook, I'd like to have the ribbon on every opened email, not on the Outlook application itself, so I set the ribbon property as Microsoft.Outlook.Mail.Read.   I saw my ribbon only on the first email I open, but not on any other later emails.  It seems the ribbon will display only once, but I have no clue how to fix this.  Could you give me any hints what I should do with this?

Thank you.

VB6 to VB Net conversion, triggering when new email arrives and global public variables

$
0
0

Hi all

Years ago I developed a VB6 routine that, when triggered by the arrival of a new email in my inbox, it would review the body and if it found certain key reference fields would save the email in msg format.  If it did not, it would then send an email the sender, advising a delay in processing there email.

I've looked at doing the same-converting my Public, Private Subs & Routines into VB VS2013 but it's not as easy as I had envisaged. 

Can anyone point me in the direction of other VB code which I could use as a template?

The resulting code would run as a rule in Outlook.

Thanks

PG

MSG/OFT email.

$
0
0

Trying to send an email using .MSG/.OFT and "CreateItemFromTemplate"

It will send once, then when you restart the machine, you have to manually recreate the files in order for the application to be able to send them again.

Works with text files, just not msg/oft

        Dim Outl As Object
        Outl = CreateObject("Outlook.Application")
        If Outl IsNot Nothing Then
            Try
                If TextBox1.Text = "" Or TextBox2.Text = "" Then
                    MessageBox.Show("Please fill in required fields.", "Blank field", MessageBoxButtons.OK, MessageBoxIcon.Information)
                Else

                    Dim omsg As Object
                    omsg = Outl.CreateItemfromtemplate("email.msg")
                    omsg.To = (TextBox1.Text)
                    omsg.Subject = (TextBox2.Text)

                    omsg.Display(False) 

Any ideas?

Blank line at the top of MAPI generated message when adding attachments

$
0
0

Hi,

I'm trying to create a simple plain text message with one single attachment using MAPI's legacy MAPISendMail (ansi) function. The email client on the test platform (and the one typically, but not necessarily all the time) being used is Outlook 2010.

Everything goes fine aside from that there is an additional annoying blank line at the top of the generated message (before any text would appear). If there is no attachment specified, the email looks fine (there is no blank line).

What do you recommend? Should I go for the newer API's like MAPISendMailW or the helper function introduced in Windows 8/Vista?

Also let me know if for some reason it is better to use the ShellExecute API with a mailto:... link - we need to attach a file, and formerly this wasn't said to be well-supported. Does it have better support now?

Our minimum target platform can be estimated as Windows 7 but it's always nice to be backward compatible.

Thank you!

Janos


Outlook 2010 add-in that creates appointment entries

$
0
0
I have developed an Outlook 2010 add-in that creates appointment entries via C#. Even though I have the newAppointment.Save(); added to the code, when Outlook closes, the user is prompted with a "Do you want to save changes?"

What do I need to do to stop the user from getting the "Do you want to save changes?" popup message?

Microsoft 2010 Outlook Express

$
0
0
Hi - I use Microsoft Outlook 2010 and just lately it takes ages to start up.  I have done the usual things like cleaning out folders and installing latest updates, but it is still taking ages.  Do you have any suggestions please?

Sort emails by size in folder

$
0
0
I have outlook add-in, written in C#. The problem I am facing is I cannot sort emails by size within a folder. Without add-in installed Outlook's Sorting does work (another account is configured ). Now I want to enquire that should I implement a sorting algo in code of add-in, so the mails in folders will be sorted or Outlook has support to sort emails for my add-in in the given folder

Outlook 2003 security dialog using C++ MFC

$
0
0

Hi,

I am trying to create an application that captures an email sent event on outlook 2003. Which i am able to get fine. But when i try to access anything from the MailItem object a pop up appears saying "an application is trying access outlook adress......" - "alllow" (the object gaurd message) . Is there any way i can turn this feature off, using registry or any other way I can By pass the prompt. 

I have read somewhere that third party applications like redemption can help with C# or VB add ins. Can it help me in C++ as well?  Want to make sure before i buy the licence 

this is the code :

///Part where i createdispatch for outlook and start the event sink
initializeOutlookEventSink()
{
	CoInitializeEx(0,COINIT_MULTITHREADED);
	if(m_pAppEventListener==NULL)
	{
	if( m_OutlookApplication.CreateDispatch(_T("Outlook.Application") ) == 0 )
    {
        AfxMessageBox(_T("FAILURE"), MB_SETFOREGROUND);
        return;
    }
//	CNameSpace olNs(m_OutlookApplication.GetNamespace(_T("MAPI")));
	//Add an event handler for the Application object.
    m_pAppEventListener = new CAppEventListener();
    m_pAppEventListener->AddRef();
    m_pAppEventListener->AttachToSource( m_OutlookApplication.m_lpDispatch );


/////////////////////////////////////
///THE PART OF CODE THAT CAUSES THE PROMPT

hr=OLEMethod(DISPATCH_PROPERTYGET, &result, pMail, L"SenderEmailAddress", 0);
	if (FAILED(hr)) return FALSE;
	senderemail = result.bstrVal;

///Where pMail is a pointer to the MailItem captured in the send event

Any help will be appriciated

Thanks

Macro to send Follow Up emails automatically

$
0
0

Hello,

So, I am searching for sometime now for a Rule, Macro or something that can do the below task:

I send out a good amount of e-mail everyday, and I manually categorise them for follow up when the recipient does not reply me in time, and they usually do not. So I would like to send a reminder e-mail, with the previous e-mail below (as if you went to the SENT folder and clicked on Reply all button) or as an attachment to the recipients with a standard message, something like:

"Did you had time to look at the e-mail below?
Regards
Me"

Call me lazy, but it is over 100 e-mail chased per week, I keep some information on an Excel Spreadsheet, then I locate the e-mail on outlook, hit Reply All button and ad something like the above on the e-mail body, and send it. I am willing to put those e-mails that are likely to require a follow up on a specific folder so I can send the follow up e-mail easily, but it would still require the clicking and pasting the text for each of them.

I would like to know if there is a faster way to do it, something like a macro or a rule that will run every Friday, read the category of the e-mails and automatically send the "Hey! I am chasing you" e-mail without me going over every single e-mail manually.

I found some macros to send e-mail automatically, but I could find one that meets the above requirements, and despise the VB is the same for Excel and Outlook, I am totally green with outlook parameters and attributes to build macros.

Can someone help me or point me a place where I can get a "sample" macro that I can customized to achieve the above?

Thank you, even if you only took time to read my question ;)

Steve "AtavoS"

How to select build-in columns for custom view for tasks

$
0
0

Hi,

I'd ike to create a custom view for tasks - I have a document how it should look like, what columns has to be there and so on. I've thought it would be easy, but it's not. How can I specify which columns are shown?

I created new view by 

OL.TableView view = (OL.TableView)olTasksFolder.Views.Add(MY_TASKS_VIEW_NAME, OL.OlViewType.olTableView, OL.OlViewSaveOption.olViewSaveOptionAllFoldersOfType);

when I try to add some buil-in columns, it tells me that I can not, beacuse it'S already there. If I look for the viewFields property and list all viewFields ViewXMLSchemaNames by

OL.TableView view1 = (OL.TableView)olTasksFolder.Views[MY_TASKS_VIEW_NAME];
                var vf1 = view1.ViewFields;
                StringBuilder sb1 = new StringBuilder();
                foreach (OL.ViewField f in vf1)
                {
                    sb1.AppendLine(f.ViewXMLSchemaName);
                }
               var result = sb1.ToString();

I get 12 listed items:

http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/811c000b
http://schemas.microsoft.com/mapi/proptag/0x0fff0102
urn:schemas:httpmail:importance
urn:schemas:httpmail:hasattachment
urn:schemas:httpmail:subject
http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81010003
http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/81050040
DAV:getlastmodified
http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-C000-000000000046}/810f0040
http://schemas.microsoft.com/mapi/proptag/0x0e05001f
urn:schemas-microsoft-com:office:office#Keywords
http://schemas.microsoft.com/mapi/proptag/0x10900003

but only 4 columns are in my view if I look in Outlook? 

How can I do it. I simply need to programatically select the proper columns, bet way is to use namespaces, because localized names would be a risk in out multiligual environment.

Thanks

Filip

Addin for Outlook2010 and 2013

$
0
0

I am developing an Outlook addin that is supposed to work in Outlook2010 and 2013.

I want use some features only available in 2013 SDK.

It is possible enable some code just if in Outlook2013?

Thanks & Regards,

Rui


Custom Outlook form for votes

$
0
0

I'm looking into the feasibility of creating an Outlook "approval" form which would do two things:

1. On the "compose" tab, let the user select 3 people from the Global Address Book to receive the form (e.g. labeled "manager", "project manager", "travel coordinator").

2. On the "read" tab, let the user click "approve" or "decline" with a text explanation.

Is it possible to do this? I'm thinking I will need to hide the "To" field and add to it when the user clicks a "send" button. I'm also thinking I would need to use the native voting buttons of Outlook to tabulate the responses in a "tracking" tab (which would include the text explanations).

Am I on the right track? Any help would be appreciated. (Unfortunately, I've been asked to look into Outlook first before Sharepoint or InfoPath.)

On a side note, I've learned that when using Voting Buttons and tabulating the responses in the "Sent" item, you cannot simply forward the sent item with the tabulated results but instead must "forward as attachment" for the recipient to see the tabulated results. Is there another way to easily forward the results?

Inspector.CurrentItem.Close() is not working

$
0
0

I am trying to open a mail ("C:\Mail.msg" file) from a fileserver location and when i close it, it leaves some references. I am unregistereing all the used events onIsnpectorClose method. but still it leaves some references and getting the below error when i am trying to access the file ("C:\Mail.msg")

My sample code...

onIsnpectorClose ()

public Inspector Inspector { get; set; } 
public MailItem MailItem { get; set; } 
if (Inspector.CurrentItem is Microsoft.Office.Interop.Outlook.MailItem &&
Inspector.CurrentItem == MailItem) 
{
Inspector.CurrentItem.Close(OlInspectorClose.olDiscard); 
}
}

Error Message

Cannot open file "C:\Mail.msg" The file may not exist, you may not have permission to open it, or it may be open in another program.


How can i close the mail item without leaving any reference behind? Kindly advise.


http://www.selvaonline.com - Live a Happy & Balanced Life


Focus problems with Task Pane and WebControl in Outlook

$
0
0

I have a simple Outlook VSTO Add-in that is not working because focus does not move into the Task Pane, as a result sometimes the backspace key (and other keys) stop working. As if because the task pane doesn't have focus, outlook is eating the keys somewhere else.

I've created a simple example project (VS2013):

https://github.com/greenkiwi/FocusAwesomiumOutlookIssue/tree/dotNetWebControlOnly

(Note you will need to check out the "dotNetWebControlOnly" branch)

When I'm using it, I can see that sometimes clicking inside the textbox doesn't cause the task pane's task bar to change colors showing that it is focused.  

I have added a Windows Textbox above the web control, where you can click and put focus into the pane.  When you do that, backspace works w/o a problem.  Then click somewhere else, like a message in your inbox, and click back in the textbox in the browser and focus doesn't move back in.

I've seen a few posts elsewhere that seem to have similar problems

StackOverflow:Outlook add in , text box , deletebackspace not working

And they provide a way that works most of the time.  Even it's method sometimes doesn't work, and feels very much like a hack.

Does anyone know what is going on and whether or not there are any ways to fix this problem?

GAL Fields in Outlook.

$
0
0

Hi

I have a code which fetches the details of the users (Alias, ManagerName) using Outlook Object. (Code snippet below).  The code works perfectly fine.  But I need to get the samAccountName property from the outlook object.  The property GetExchangeUser.Alias gets the Alias name which I saw is not always same as the samAccountName (Network Account Name).  Any help or pointers on this would be of great help.  Thanks in advance.

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

    ' Initialize a new instance of Outlook Application NOTE: Outlook needs to be open to be able to fetch the DL details
    Set oApp = New Outlook.Application
    Set oNS = oApp.GetNamespace("mapi")

    Set oDLs = oNS.AddressLists

    Set oGAL = oDLs.Item("All Groups")
        
    Set oEntries = oGAL.AddressEntries
    Set oDL = oEntries.Item(cDLName)

    cDLNameinOutlook = ReplaceString(oDL.Name, Space(1), "")
    cDLNameinOutlook = ReplaceString(cDLNameinOutlook, Chr(150), "")
    cDLNameinOutlook = ReplaceString(cDLNameinOutlook, Chr(45), "")
        
    cDLNameInDLM = ReplaceString(rst!FullDLName, Space(1), "")
    cDLNameInDLM = ReplaceString(cDLNameInDLM, Chr(150), "")
    cDLNameInDLM = ReplaceString(cDLNameInDLM, Chr(45), "")

     If cDLNameInDLM = cDLNameinOutlook Then

            ' Get all of the members of the distribution list.
            Set oMemberEntries = oDL.Members
            
            On Error GoTo EH_NotResolved

            ' Loop through each members in the DL
            For i = 1 To oMemberEntries.Count
            
                On Error GoTo EH_Individual
               
                Set oEntry = oMemberEntries.Item(i)

                cUserName = oEntry.Name
                cLANID = Left(oEntry.GetExchangeUser.Alias, 20)
                cEMail = oEntry.GetExchangeUser.PrimarySmtpAddress
                cOffice = oEntry.GetExchangeUser.OfficeLocation

Regards
Ravi

automatically process or import or accept an attached .ics file using VBA

$
0
0
I regularly receive appointments saved as .ics files in Outlook. There is no possibility of changing how the content is delivered at this time.  Are there any add-ins or VBA code allowing automatic handling of the attached .ics files?
Viewing all 6421 articles
Browse latest View live


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