Quantcast
Channel: Visual Studio Tools for Office (VSTO) forum
Viewing all 5157 articles
Browse latest View live

Excel add-in won't load when opening Outlook attachment

$
0
0

Hey everyone. I've run into a situation where my Excel 2010 automation add-in won't load when opening an Excel file as an attachment. More specifically, only in the situation where I have Excel already opened (and the add-in running fine) and then try to open the Excel attachment. 

My LoadBehavior is set to 3 and the add-in runs fine in all other situations. I should note that this isn't on my development machine, but a user's computer running Excel 2010 and Windows 7. Could this be as simple as telling Windows to open Excel files in the same instance? 

thanks!


How to read out Outlook MailItem's path?

$
0
0

Hi,

there is a way to open a mail item from a path to a .msg file.

var mail = Globals.ThisAddIn.Application.Session.OpenSharedItem(path) as Outlook.MailItem;


I would like to know if it is possible to detect the path of a mail item which was opened from a .msg file?

ribbon load event, thisAddin startup event, why does the firing order of these events change?

$
0
0

So , during the last few days i've developed a small prototype for Outlook 2010, using VSTO. it works fine so far, no problems. I had assumed that, first of all, the entry point of any custom addin for office was the startup event inside the thisAddin class. So, it was here where i would do all the usual security/user profile stuff (i.e: I'd check the current identity user, query some databases where we store roles/permissions etc, checking what that user is/is not allowed to do, and load some custom security object). Once i had this object loaded in the addin startup event, id check for it on any ribbon load event, enabling or chainging the visibility on the different controls.

Now, i have to migrate this prototype to word 2010. To my surprise, the chain or events is the opposite: ribbon load events are being fired first of all, and finally comes the startup event in thisAddin.

What could be causing this?

Thanks


.vsto file not getting invoked for Outlook 2013 addin

$
0
0

hi,

I just migrated our custom signature addin for Outlook 2013 to VS 2013 and used InstallShield for deployment.

Everything seems to get created like registry key and all the files under program files:

Manifest entry:file:///C:\Program Files\[custom app directory]\Office.Outlook.AddIn.EmailSignatures.vsto|vstolocal

and I have all the relevant files including the .vsto in C:\Program Files\[Custom App Directory]

The issue I'm facing is the add-in does not get invoked when I start Outlook 2013. I've to manually go in and invoke the .vsto and then it add the Custom Add-in.

One thing I noticed when I invoke the .vsto I get the following prompt 'cause of the certificate, but I've already installed the certificate. I'm not sure if this the cause of the add-in not getting installed on its own. Is there some way to get rid of this prompt ?

thanks.

 

how to create dropable gallery menu?

$
0
0

in word addin develop , can add custom menu like this?

InfoPath crashes when OOB People Picker control is used with SharePoint and claims auth.

Excel 2013 Can't change height of ChartArea

$
0
0

Hi,

I've inherited an Excel 2007 solution and am working to update it to work in Excel 2013. It's a Template-level solution using C# and running in Visual Studio 2013.

I haven't done a lot with Excel, so forgive me if this is a basic question.

In my code, I create a chart and place it on a ChartSheet based on a ChartTemplate that's stored in the .xlst file.  Then I try to adjust some of the settings of the chart's ChartArea.  However, when I try to adjust the height with this line of code:

newChart.ChartArea.Height = 300;

I get this exception:

System.ArgumentException: The shape is locked and cannot be resized.
   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
   at Microsoft.Office.Interop.Excel.ChartArea.set_Height(Double value)

If I manually do the same steps, once I move a Chart from a regular worksheet to a ChartSheet, the size options are greyed out. This doesn't happen in Excel 2007.

Do you have any ideas for a work-around?

Microsoft Visual Studio 2010 Tools for Office Runtime installation fails with 0x80070643

$
0
0

We distribute an Excel document customization that uses the VSTO 4.0 runtime.  It has installed successfully on thousands of customers' computers, but one customer reports that the runtime fails to install.  He has provided a setup log, which I'm including below, but it doesn't provide much detail ("Exe (c:\e90d9681e1814a377c00\vstor40\vstor40_x64.exe) failed with 0x80070643 - Fatal error during installation.").

Is there some way to gather more information that would help diagnose this problem?  I don't know what to look at.

Please note that the customer is attempting to install Visual Studio 2010 Tools for Microsoft Office Runtime,not Visual Studio or the .NET Framework.

Thanks,
Tony

Setup log:

OS Version = 6.0.6000, Platform 2
OS Description = Vista - x64 Home Premium Edition
CommandLine = c:\e90d9681e1814a377c00\Setup.exe
TimeZone = Eastern Daylight Time
Initial LCID = 1033
Using Simultaneous Download and Install mechanism
Operation: Installing
Package Name = Microsoft Visual Studio Tools for Office Runtime 2010 Setup
Package Version = 10.0.50325
User Experience Data Collection Policy: UserControlled
Number of applicable items: 4
ServiceControl operation succeeded!
Patch (c:\e90d9681e1814a377c00\VC_Red_x86\msp_kb2565063.msp) Install succeeded on product (Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219). Msi Log:
Patch (c:\e90d9681e1814a377c00\VC_Red_x64\msp_kb2565063.msp) Install succeeded on product (Microsoft Visual C++ 2010 x64 Redistributable - 10.0.40219). Msi Log:
Exe (c:\e90d9681e1814a377c00\vstor40\vstor40_x64.exe) failed with 0x80070643 - Fatal error during installation. .
Final Result: Installation failed with error code: (0x80070643), "Fatal error during installation. " (Elapsed time: 0 01:00:14).


-- Tony



Applying Chart Template from Project Resource

$
0
0

Hey guys,

the following situation:

I'm developing a excel addin (Office Excel 2013) and would like to save a chart template within my project ... as embedded resource or whatever and would like to apply these template to a chart (easy command: chartObj.Chart.ApplyChartTemplate(path)) ... but the path is my problem. I have no idea where to get it ...

Any suggestions?

Excel VSTO Add-In: Cannot reactivate Excel after MessageBox.Show("Test");

$
0
0

Reproducable with Windows XP - ... and Excel 2007 - ...:

  1. I do open Excel and create two or more new workbooks
  2. I do show a modal dialog, let's say via "MessageBox.Show" I open "notepad" and maximize its window
  3. I try to reactivate one of the excel workbook windows via the windows taskbar
  4. I expect: Excel will come up with my modal MessageBox to appear on top
  5. The actual result is: Neither the MessageBox nor any of the Excel workbooks comes up, when you click a workbook item in the windows taskbar!

=> See more details and short code example here: http://stackoverflow.com/q/20688734/1413641


range.Value2 = myArray is Honoring Autofilter! Help!

$
0
0

My code is working great and fast.  I grab a range...

                Excel.Range dataRange = Globals.ThisAddIn.Application.ActiveWorkbook.Names.Item(rangeAddress).RefersToRange;

get the values into an array...

                object[,] myValues = (object[,])dataRange.Value2;

Manipulate them, and then write them back with...

                    dataRange.Value2 = myValues;

That is, it all works until autofilter screws things up.  It seems Value2 is skipping the rows that are auto-filtered, which is HORRIBLE, since auto-filter is really just for display.  The kick in the teeth is, that the dataRange itself STILL comes back the correct size as it is WITHOUT the autofilter, so it's not even consistent in that regard!

How can I manipulate my sheet values efficiently (ie, without writing cell by cell) with autofilter on?

Thanks

Ray

Powerpoint ShowWindowsInTaskbar not supported

$
0
0

Hello All,

I was wondering why the ShowWIndowsInTaskBar is no longer working (not supported) in Office 2010. It's working for excel and word but not for powerpoint (both in VSTO as in Vb).

Any help is much appriciated

regards

Arie

VSTO Outlook 2010 Send Meeting Request to New and Deleted

$
0
0

Hi,

Is there any way to send meeting requests to new recipients that have been added and not the existing ones? I have been looking for some kind of flag but don't seem to be able to find one.

I have made changes to an AppointmentItem object and would like to the Send to only affect new and deleted recipients (as you are prompted to do in Outlook).

Thanks

C# To Create A SQL Server Connection in Excel

$
0
0

I know the syntax to connect to access and link in a query to make the worksheet refresh the query.  But how can I use C# to create a connection to SQL Server, embed a SQL statement into that worksheet and save the connection within the workbook so that the connection/sql statement can be refreshed from within Excel?
For example, if I record an Excel Macro with the steps this is the output, but I can not translate to C#

With ActiveWorkbook.Connections( _"Brimstone TestDB TestTable").OLEDBConnection
        .BackgroundQuery = True
        .CommandText = Array("Select * From testTable")
        .CommandType = xlCmdSql
        .Connection = Array( _"OLEDB;Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Data Source=Titanium;Use Procedure for Prepare=1;Auto Tr" _
        , _"anslate=True;Packet Size=4096;Workstation ID=TB;Use Encryption for Data=False;Tag with column collation when possible=False" _
        , ";Initial Catalog=Pandora_Reporting")
        .RefreshOnFileOpen = False
        .SavePassword = False
        .SourceConnectionFile = ""
        .SourceDataFile = ""
        .ServerCredentialsMethod = xlCredentialsMethodIntegrated
        .AlwaysUseConnectionFile = False
        .ServerFillColor = False
        .ServerFontStyle = False
        .ServerNumberFormat = False
        .ServerTextColor = False
    End With
    With ActiveWorkbook.Connections( _"Brimstone TestDB TestTable")
        .Name = "Refresh_Name"
        .Description = ""
    End With

VSTO Word Add-in - How to disable drag drop of content controls

$
0
0

Hi, i've a problem in the developing of a word add-in.

when i drag and drop a content control, it create a copy of it that is unmanageable. I can't delete or update it with the controls of my add-in. 

There is a way to disable the drag&drop in the word document handled by my add-in? or can i avoid the copy of the content control? 


app.ActiveProject.Tasks Throws System.InvalidCastException

$
0
0

Yesterday the code below worked. Today app.ActiveProject.Tasks throws a System.InvalidCastException exception. Last night I had 63 updates for Microsoft Office Professional Plus 2010. How do I figure out what is going wrong and keep it from failing with future updates?

public void DoSomething()

{

app = new Microsoft.Office.Interop.MSProject.Application;  // Microsoft Office Project Standard 2007
app.FileOpenEx(_fileName, false);
Microsoft.Office.Interop.MSProject.Tasks tsk = app.ActiveProject.Tasks; // app.ActiveProject.Tasks Throws System.InvalidCastException in the Watch window and when this statement is executed.

}

You Cannot DEBUG - Required Version of Office Not Installed

$
0
0

Hi friends,

My Office 2010 + VS 2010 were going on good enough. Unfortunately the day I had MS-Office 2013 installed the moment I start to debug any project with an F5 upcomes the message:

You cannot debug or run this project, because the required version of the Microsoft Office application is not installed.

How can I simply create an Excel 2010 Add In from the VSTO templates available for the same in the VS 2010, although I have Office 2013 installed?

Please see if you can help.

Thanx in advance.


Best Regards, Faraz A Qureshi

How can I collapse the entire ribbon when editing a new mail message?

$
0
0

I am trying to automatically collapse the ribbon when a message compose window is opened.  The ribbon can be collapsed by the user by typing Ctrl + F1.  If this were an Add-In for Microsoft Word, I think this would be accomplished by executing

Globals.ThisAddIn.Application.ActiveWindow().ToggleRibbon();

However, since this is an Outlook Add-In it appears to be more difficult.  I want this to be done when the compose window is first opened so I have added an Activate event handler on the inspector.  From within the Activate event handler I am trying to execute this code:

Microsoft.Office.Interop.Word.Document wd = inspector.WordEditor as Microsoft.Office.Interop.Word.Document;
Microsoft.Office.Interop.Word.Window w = wd.ActiveWindow as Microsoft.Office.Interop.Word.Window;

if (w != null)
{
	w.ToggleRibbon();
}

Unfortunately I get an exception on the second line:

This object model command is not available in e-mail.

How can I collapse the ribbon when a new mail compose window is opened?

Thanks.

Alt+Tab causes CustomTaskPane to be shown on the Wrong PowerPoint Window

$
0
0

We are seeing a behavior in PowerPoint that causes custom task panes to be displayed on the wrong PowerPoint window. This behavior can be replicated by having two PowerPoint window open and Alt+Tabbing right after clicking a ribbon button that adds a custom taskpane. Alt+Tab sets the focus on the second PowerPoint application where the custom task pane appears, even if we passed in the DocumentWindow we Alt+Tabbed from to the CustomTaskPanes.Add() call. The DocumentWindow is retrieved through the ribbon button via IRibbonControl.Context as DocumentWindow.

We also tried passing in a DocumentWindow directly from the PowerPoint.Application.Windows[n] collection, resulting in the same behavior described above.

It seems that PowerPoint is relying on ActiveWindow internally rather than the DocumentWindow that was passed in the CustomTaskPanes.Add() call.

Word and Excel behave normally the custom task pane is displayed in the correct window after an Alt+Tab. We are passing in the respective objects to CustomTaskPanes.Add as described in http://msdn.microsoft.com/en-us/library/bb608620.aspx

Thank you.

VSTOInstaller /silent not supported

$
0
0
We currently have a number of users with an OLD add-in for Project that needs to be removed. I'm trying to use VSTOInstaller to remove the add-in through SCCM, but it wasn't built with support for the /silent option. Is there any way around this after the fact? Or any other methods I could possibly use to automate the uninstall from users where it's currently installed without prompting them?
Viewing all 5157 articles
Browse latest View live


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