Search Results

Search found 188 results on 8 pages for 'vsto'.

Page 3/8 | < Previous Page | 1 2 3 4 5 6 7 8  | Next Page >

  • VSTO Word ContentControls, Y U No have Name property?

    - by System.Cats.Lol
    When you add a VSTO (not Word native) content control, you specify the name: controls.AddContentControl(wordRange, "foo", wdType); Where controls is the VSTO (extended) Document.Controls collection. You can later look up the control by name: ContentControl myContentControl = controls["foo"]; So why in the world is there no Name property for ContentControl? (or ContentControlBase, or any of the other derivatives). I'm implementing a wrapper class for the Document.Controls property that lets you add or iterate the content controls. When iterating the underlying Document.Controls, there's no way to look up the name of each control. (We need it to return an instance of our ContentControl wrapper). So currently I'm doing this in our ContentControls wrapper class: public IEnumerator<IContentControl> GetEnumerator() { System.Collections.IEnumerator en = this.wordControls.GetEnumerator(); while (en.MoveNext()) { // VSTO Document.Controls includes all managed controls, not just // VSTO ContentControls; return only those. if (en.Current is Microsoft.Office.Tools.Word.ContentControl) { // The control's name isn't stored with the control, only when it was added, // so use a placeholder name for the wrapper. yield return new ContentControl("Unknown", (Microsoft.Office.Tools.Word.ContentControl)en.Current); } } } I'd prefer to not have to resort to keeping a map of names-to-wrapper-objects in our ContentControls object. Can anyone tell me how to get the control's name (the name parameter that was passed to Controls.Add()?

    Read the article

  • How to determine if VSTO 2010 Runtime is Installed?

    - by Joel
    It was easy to check if VSTO 2005 SE was installed by just calling MsiGetProductInfo() with the product code {388E4B09-3E71-4649-8921-F44A3A2954A7}, as listed in MSDN. What is the product code for the VSTO 2010/4.0 runtime? Or is there a better way to determine if it's already installed? This is for our installation process. Thanks! Also, I am trying to figure out the same for Windows Imaging Component.

    Read the article

  • How can I set PivotField.Calculation in Excel/VSTO?

    - by Kang Su
    I'm trying to set the Calculation property on an OLAP PivotField with VSTO 3.0. For example: pivotField.Calculation = XlPivotFieldCalculation.PercentOf; If I do the above, the value I assign does not stay (Excel appears to revert the change). I suspect the reason is that the BaseField property of the PivotField also needs to be populated (as PercentOf needs a BaseField). But it appears to me that you can't set the BaseField property until you've set the Calculation property (otherwise you get a COMException). I've tried to set ManualUpdate on the PivotTable to true, but with VSTO this rarely works, as this gets reverted immediately back to false. Note, that this seems to work fine in VBA as you can assign multiple values in a single statement, like this: With ActiveSheet.PivotTables("PivotTable1").PivotFields("[Measures].[Reseller Sales Amount]") .Calculation = xlPercentOf .BaseField = "[Geography].[Geography].[Country]" .BaseItem = "[Geography].[Geography].[Country].&[France]" .NumberFormat = "0.00%" End With But with C#/VSTO there's no construct like this (that I know of) and I'm stuck not able to do something like the above. Further note, Calculation values that don't require a BaseField, e.g., XlPivotFieldCalculation.xlPercentOfTotal, get set just fine. Any help on this would be greatly appreciated!

    Read the article

  • How do I add a VSTO project as a reference to a unit testing project?

    - by Mathias
    In order not to pollute my projects with unit tests, I like to create a separate project for my unit tests; I add a reference to the project under test in the unit tests project. However, this isn't working that well with my VSTO excel add-in projects: when I create a separate unit test project and go to Add Reference Projects, there is no project to pick. What I have done so far is Add Reference Browse, and pick the add-in dll from the debug folder. I have also run into issues from time to time with this, with the reference suddenly not working, requiring to remove/re-add the dll reference. Can anybody explain why a VSTO project doesn't show up as a regular project? And is there a better way to go about it than what I am doing presently?

    Read the article

  • Getting accounts from Outlook 2007 using VB.NET in VSTO

    - by Pranav
    This is a sample code for getting Email accounts which are configured in Outlook 2007. This is developed using native code of VSTO. We can also implement is using 3rd party libraries like Redemption. Dim olAccounts As Outlook.Accounts = Globals.ThisAddIn.Application.ActiveExplorer().Session.Accounts Dim acc As Outlook.Account MessageBox.Show(“No. of accounts: ” & olAccounts.Count.ToString) If olAccounts.Count > 0 Then ReDim emails(olAccounts.Count) For Each acc In olAccounts MessageBox.Show(“Name: ” & acc.UserName & “Email: ” & acc.SmtpAddress) Marshal.ReleaseComObject(acc) Next Else MessageBox.Show(“There are no accounts in Outlook”) End If  Hope this helps!

    Read the article

  • How to create Automation Add In Formula/Function and Excel Add In buttons (vsto) for them together?

    - by ticky
    Ok, let me explain it little bit better. Here is one example how to create formula/functions http://blogs.msdn.com/b/eric_carter/archive/2004/12/01/273127.aspx?PageIndex=1#comments I implemented something like that, I even added values in registry, so that this Automation AddIn doesn't have to be added manually in Excel, but automatically.. I created SETUP project for this project and it works GREAT. Then.. After some time, I wanted to create buttons in Excel for functions that I use. Those are custom functions, using some web services. I created Excel AddIn and added Ribbon with buttons - one button = one custom function. I can publish this project and I am creating VSTO, so this way, I can install excel ribbon buttons in custom group of mine. Now, I have 2 installations, first for Automation AddIn and second for Excel AddIn. How can I connect them? I tried to include VSTO to Setup - something like this: [I WILL ADD IT LATER] When I install it, it works great, it installs both parts. But when I install on my friends computer, it doesn't shows Ribbon buttons. What could be the problem? If there is some other way to integrate those two, I would be very grateful!!!!! Thanks! Tijana

    Read the article

  • Naming PowerPoint Components With A VSTO Add-In

    - by Tim Murphy
    Note: Cross posted from Coding The Document. Permalink Sometimes in order to work with Open XML we need a little help from other tools.  In this post I am going to describe  a fairly simple solution for marking up PowerPoint presentations so that they can be used as templates and processed using the Open XML SDK. Add-ins are tools which it can be hard to find information on.  I am going to up the obscurity by adding a Ribbon button.  For my example I am using Visual Studio 2008 and creating a PowerPoint 2007 Add-in project.  To that add a Ribbon Visual Designer.  The new ribbon by default will show up on the Add-in tab. Add a button to the ribbon.  Also add a WinForm to collect a new name for the object selected.  Make sure to set the OK button’s DialogResult to OK. In the ribbon button click event add the following code. ObjectNameForm dialog = new ObjectNameForm(); Selection selection = Globals.ThisAddIn.Application.ActiveWindow.Selection;   dialog.objectName = selection.ShapeRange.Name;   if (dialog.ShowDialog() == DialogResult.OK) { selection.ShapeRange.Name = dialog.objectName; } This code will first read the current Name attribute of the Shape object.  If the user clicks OK on the dialog it save the string value back to the same place. Once it is done you can retrieve identify the control through Open XML via the NonVisualDisplayProperties objects.  The only problem is that this object is a child of several different classes.  This means that there isn’t just one way to retrieve the value.  Below are a couple of pieces of code to identify the container that you have named. The first example is if you are naming placeholders in a layout slide. foreach(var slideMasterPart in slideMasterParts) { var layoutParts = slideMasterPart.SlideLayoutParts; foreach(SlideLayoutPart slideLayoutPart in layoutParts) { foreach (assmPresentation.Shape shape in slideLayoutPart.SlideLayout.CommonSlideData.ShapeTree.Descendants<assmPresentation.Shape>()) { var slideMasterProperties = from p in shape.Descendants<assmPresentation.NonVisualDrawingProperties>() where p.Name == TokenText.Text select p;   if (slideMasterProperties.Count() > 0) tokenFound = true; } } } The second example allows you to find charts that you have named with the add-in. foreach(var slidePart in slideParts) { foreach(assmPresentation.Shape slideShape in slidePart.Slide.CommonSlideData.ShapeTree.Descendants<assmPresentation.Shape>()) { var slideProperties = from g in slidePart.Slide.Descendants<GraphicFrame>() where g.NonVisualGraphicFrameProperties.NonVisualDrawingProperties.Name == TokenText.Text select g;   if(slideProperties.Count() > 0) { tokenFound = true; } } } Together the combination of Open XML and VSTO add-ins make a powerful combination in creating a process for maintaining a template and generating documents from the template.

    Read the article

  • VSTO: Attach meta-data to a cell in Excel?

    - by Gustav
    Hi! I'm using VSTO to create an Excel Add-on. This add-on retrieves and display alot of data from a sql-server. This works great, but later on I plan to access some of the data inside excel and modify it in some ways. My problem is that I need a way of classify cells that I want to modify. Is there any way to add meta-data to a cell to know if it is a cell that should be modified? E.g. add a attribute to the cell, e.g. "editable_cell", and do something like Excel.FindCellsWithAttribute("editable_cell") to find the sought after cells? Thanks! /Gustav

    Read the article

  • How to determine where a Mailitem is being opened from in Outlook 2007 using VSTO 2005 SE

    - by Adam
    I have an Outlook 2007 Add-in in VSTO 2005 SE that allows users to save e-mails into our document management system. From within our system users are able to open e-mails they have previously saved. However, when doing so I need to try and prevent them from saving them again. I am trying to figure out how to determine if the Mailitem being opened is coming from the Outlook e-mail client or from an external source. I know that normally the EntryId Property of the Mailitem is null or empty string when a Mailitem has not been previously saved in Outlook, however, it seems like when a Mailitem is being opened from within our system the EntryID is not null.

    Read the article

  • How do I reference an unsigned assembly from a VSTO Word Doc project?

    - by Gishu
    I created a new project in VS2008. Project type Visual C# > Office > 2007 > Word 2007 Document Added some code.. got Word to do a few jumps through some custom hoops.. all fine. Now I need to reference another assembly (CopyLocal as false) which is not signed. So I add the project reference. Now the project will not build complaining error MSB3188: Assembly 'X.dll' must be strong signed in order to be marked as a prerequisite. The error code page is concise (now accustomed to this) Been googling and reading posts ever since.. No Luck. How do I get around this ? Or is the hidden commandment that all references (for VSTO?) must be strong named / signed. I cannot sign 'X.dll' and be done with it because it is a binary that I don't control also it depends on another bunch of unsigned dlls.. can't set off a chain sign reaction. Update: Solved the build issue by turning CopyLocal=True. But this meant dumping the referenced X.DLL and all its dependencies into the bin\debug folder... Ughh! Tried creating a subfolder called bin\debug\refExecs and referencing X.dll CopyLocal=false from there. The error message was back.

    Read the article

  • Upgrading VSTO project to .net 4 - What references do I actually need?

    - by Dana
    I'm developing an application for Office. It originally targeted .net 3.5, but I decided to upgrade to .net 4 because of some WPF issues that I've run into. When I switched all the projects in my solution and rebuilt, I got an error saying to include System.Xaml. I did that and rebuilt, and VS2010 told me to include another reference, so I did. This happened a couple more times, and finally it asked me to include Microsoft.Office.Tools.Common.v9.0, and when I did I got this error: Microsoft.Office.Tools.CustomTaskPaneCollection exists in both Microsoft.Office.Tools.Common.v9.0.dll and Microsoft.Office.Tools.Common.dll I have both Microsoft.Office.Tools.Common.v9.0 and Microsoft.Office.Tools.Common referenced in my project, but the problem is that if I remove either, I get an error. Am I doing something wrong? Is it odd that I would need both references? I find it strange that CustomTaskPaneCollection would be defined in two different binaries. If I remove Microsoft.Office.Tools.Common, the error that I get is "Cannot find the interop type that matches the embedded interop type 'Microsoft.Office.Tools.IAddInExtension'. Are you missing an assembly reference?"

    Read the article

  • VSTO - Outlook 2007 How do I show a user property even when it's not present?

    - by Yandros
    I have added user property in a mail folder, let's call it UserProperty01. Some of the folder items have this property, some don't. I need to show in the folder's view if that property is set or not, so I added another property called UserProperty01Present, and I set it to true when I set the original property and false when I deleted it; then I added it to the folder's view. The problem is that the little checkbox appears checked in those mails where the property is set, blank in those where the property was deleted... and nowhere at all in those where the property was never set in the first place. My question is, is there any way to show the blank checkbox when the property is not set? The only alternative I found so far is looking in every mail item and setting it to false when it's not set every time the folder is opened; needless to say, I'm not very happy with this solution. Is there any other way? Thank you for your time.

    Read the article

  • How to best fetch a cell value from excel using VSTO?

    - by Behrooz Karjooravary
    I am trying to get cells from excel into csharp but not sure what's the best variable type to read it into. If I make the variable a string and the cell value is a double I get a parse error. If I make the variable double then when the cell is a string it wont work. Here's the code I am running: try { string i = Globals.Sheet1.Cells[7, 7].Value; double num; if (i == null) return; if (double.TryParse(i, out num)) { . . . } } catch (Exception e) { MessageBox.Show(e.ToString()); }

    Read the article

  • ClickOnce: The required version of the .NET Framework is not installed on this computer

    - by Martin
    I have been getting the error "The required version of the .NET Framework is not installed on this computer." (Event Id 4096 in Event log) when trying to install a VSTO application from both a ClickOnce deployment and a local copy. This is interesting as the .NET framework is installed (on my 32bit Windows 7 PC) and the VSTO application was developed on the self same machine (and works in Visual Studio 2008). Does anybody has an idea why I could get this exception? Name: From: http://localhost/BlaBla.vsto "The required version of the .NET Framework is not installed on this computer." ********** Exception Text ********** Microsoft.VisualStudio.Tools.Applications.Deployment.InstallAddInFailedException: "The required version of the .NET Framework is not installed on this computer." at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn() at Microsoft.VisualStudio.Tools.Office.Runtime.SolutionInstaller.<c__DisplayClass7.b__0()

    Read the article

  • Installing Office Customization

    - by user187229
    Name: From: file:///D:/Samples/TestUpdatedVersion/bin/Debug/TestUpdatedVersion.vsto The customization cannot be installed because another version is currently installed and cannot be upgraded from this location. To install this version of the customization, first use Add or Remove Programs to uninstall this program: TestUpdatedVersion. Then install the new customization from the following location: file:///D:/Samples/TestUpdatedVersion/bin/Debug/TestUpdatedVersion.vsto ********** Exception Text ********** Microsoft.VisualStudio.Tools.Applications.Deployment.AddInAlreadyInstalledException: The customization cannot be installed because another version is currently installed and cannot be upgraded from this location. To install this version of the customization, first use Add or Remove Programs to uninstall this program: TestUpdatedVersion. Then install the new customization from the following location: file:///D:/Samples/TestUpdatedVersion/bin/Debug/TestUpdatedVersion.vsto at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.VerifySolutionCodebaseIsUnchanged(Uri uri, String subscriptionId, Boolean previouslyInstalled) at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InstallAddIn()

    Read the article

  • Is it possible to customize the Outlook Conferencing Add in?

    - by ria
    I want to modify the labels of the outlook conferencing add in... e.g. I want to change the "Schedule a live meeting" text to say "Schedule my meeting". is it possible using VSTO? or I can create only new add ins using VSTO and not customize the existing ones ?? (I am talking abt this conferencing add in: http://aspoc.net/archives/2008/09/10/download-the-office-live-meeting-2007-client-and-conferencing-add-in-for-outlook/)

    Read the article

  • What is the C# equivalent of this Excel VBA code for Shapes?

    - by code4life
    This is the VBA code for an Excel template, which I'm trying to convert to C# in a VSTO project I'm working on. By the way, it's a VSTO add-in: Dim addedShapes() As Variant ReDim addedShapes(1) addedShapes(1) = aBracket.Name ReDim Preserve addedShapes(UBound(addedShapes) + 1) addedShapes(UBound(addedShapes)) = "unique2" Set tmpShape = Me.Shapes.Range(addedShapes).Group At this point, I'm stumped by the addedShapes(), not sure what this is all about. Update: Matti mentioned that addedShapes() represents a variant array in VBA. So now I'm wondering what the contents of addedShapes() should be. Would this be the correct way to call the Shapes.Range() call in C#? List<string> addedShapes = new List<string>(); ... Shape tmpShape = worksheet.Shapes.get_Range (addedShapes.Cast<object>().ToArray()).Group(); I'd appreciate anyone who's worked with VBA and C# willing to make a comment on my question & problem!

    Read the article

  • Retrieving Data from SQL Server within Excel 2007

    - by Russell Giddings
    I have the following requirements I have relational content stored in a SQL Server 2005 database. I want to retrieve this data, transform it and display it in an Excel 2007 document. I would like this to be pulled from within Excel at the click of a button. As far as I can tell I have the following options... Create a view in Sql Server and reference it within a pivot table using a data connection. Create an Excel workbook using VSTO and create a web service which the workbook pulls data from Create a web service and use JScript with XMLHTTP request objects I currently only have a little experience of any of these methods (I'm very familiar with SQL Server although not pivot tables, I've created many web services although I've never used VSTO and I've used javascript extensively, but never in the context of Excel manipulation). Would you recommend one of the above approaches or is there a better way to do this?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8  | Next Page >