vsto

How do you associate custom metadata to an MS Office file and have it persist even after the file closes In VSTO?

冷暖自知 提交于 2019-12-25 01:13:47
问题 I need to store metadata about a Microsoft office file and have it persist even after the file is closed and re-opened. I am using VSTO 2007 and writing an addon for Microsoft Office ribbon. How can this be done? 回答1: If your metadata looks like a few key/value pairs, you could use Custom Properties. 来源: https://stackoverflow.com/questions/6889738/how-do-you-associate-custom-metadata-to-an-ms-office-file-and-have-it-persist-ev

Viso VSTO - ShapeAdded event not firing (sometimes)

人走茶凉 提交于 2019-12-24 20:18:05
问题 In my Add-in for Visio, I have set a handler for 'ShapeAdded'. This fired for the first 2 or 3 shapes that are added, but then just stop firing altogether. Here's the basic outline of how my add-in functions: User adds shape to page On ShapeAdded, a form is displayed. User enters text in form, presses search button Call to stored Procedure (parameter = user text) Form's datagridview is populated with results. User double-clicks result row required. Form closes, selected value becomes shape

Pass Data into a VSTO Excel Workbook?

回眸只為那壹抹淺笑 提交于 2019-12-24 20:14:11
问题 I've got an VSTO Excel Workbook project that I'm using to gather information from a user. This workbook is being launched from inside of a host application, but I need to pass some parameters to the workbook before opening it so it knows what to display and how to display it. What's the best way to do this? 回答1: There is a way of passing data to a workbook which personally I don't really like, but maybe it can suit you. Basically, you set values for specific cells in the workbook, and then

Excel VSTO, Workbook Open Event Not Firing

大憨熊 提交于 2019-12-24 18:55:30
问题 I've got the code below in an Excel Addin Proect in VB.Net: Public Class ThisAddIn Private Sub Application_WorkbookOpen(Wb As Microsoft.Office.Interop.Excel.Workbook) Handles Application.WorkbookOpen Beep() MsgBox("fad") End Sub End Class This was generated by the VB editor. It is the event handler for when the workbook is opened. When I press F5 and run the code, apparently the event handler doesn't execute. Any Ideas? Edit: The event handler will run if I open a workbook from the workbook

Launch the vba editor from excel by code

空扰寡人 提交于 2019-12-24 18:35:03
问题 In Vsto-excel project , i have a macro in a particular module. By code in c#, i want to launch the VBA editor showing the given macro . i know the interop concepts , but i m stuck at launching the vba editor and showing the particular macro. 回答1: You can use Application.Goto "MarcoName" which will open up the VBE at the sub / macro you specify. 回答2: The keyboard shortcut ALT + F11 on a open excel sheet ,opens the VBA Editor by default. Use the excel interop to open the excel and make the

VSTO Ribbon not showing when starting from blank Solution

最后都变了- 提交于 2019-12-24 16:31:52
问题 If I create a new 'Excel 2013 and 2016 VSTO Add-in' Project from the File/New Project... menu, and then Project/Add New Item... -> Ribbon (Visual Designer), everything works fine: when I launch the App I have my Ribbon showing in Excel. But if I first create a 'Blank Solution', and then add an Excel VSTO Project from the File/Add/New Project...: if I add a Ribbon item in the project it does not show in Excel. That must mean I have to set a reference to the Ribbon somewhere in the Solution

PowerPoint Programming: Indentation with Ruler margin levels not working?

瘦欲@ 提交于 2019-12-24 10:01:02
问题 Recently we upgraded one our PowerPoint addin to support 2007 and 2010. most of the items we were able to port without problem. one problem we have is that indentations doesn't work when create tables or shapes using the addin. for eg: same table gets dropped with proper indentation in 2003 but same thing doesn't get indentation when added to using 2007. below is the code snippet that allows indenting: With PropertyValues.ObjShape.Table.Cell(row, col).Shape.TextFrame.Ruler For rulerCount = 0

Excel.Application.SelectionChange fires only once

放肆的年华 提交于 2019-12-24 09:47:59
问题 I'm getting only the first event notification, and nothing happens after. Any ideas? UPD: I've found a strange thing. My code for event handler looked like this: var cell = range.Cells[1, 1]; var rangeName = cell.Address[false, false, XlReferenceStyle.xlA1, Type.Missing, Type.Missing]; I've changed it in this way, adding explicit type cast: var cell = (Range)range.Cells[1, 1]; var rangeName = cell.Address[false, false, XlReferenceStyle.xlA1, Type.Missing, Type.Missing]; And now my event

C# Interop format Validation List

妖精的绣舞 提交于 2019-12-24 09:17:30
问题 I implemented a code that adds Data Validation on cells from a specified range, but the values that contain , are chunked into pieces... This is my code var listFormats = new List<string>(); listFormats.Add("US punctuation + alphanumeric lowercase:[a-z0-9,.?;:!&()_'" + '"' + "]+"); listFormats.Add("US punctuation + alphanumeric uppercase:[A-Z0-9,.?;:!&()_'" + '"' + "]+"); listFormats.Add("US punctuation + alphanumeric mixedcase:[A-Za-z0-9,.?;:!&()_'" + '"' + "]+"); var flatListFormats =

Loading specific test file for debugging MSProject Add-In

核能气质少年 提交于 2019-12-24 08:59:07
问题 I am developing a MSProject add-in with VSTO and I have a question about debugging. How do I use the Start Option->Command line arguments to load a specific MS Project file? I have tried using [drive:][path]filename.mpp but the file doesn't load. Otherwise everything is fine. I can load a file manually and debug properly. Thanks for any assistance. 回答1: You can use the following command line example to load MS Project with a specific MPP file: winproj "c:\projects\Annual Report Preparation