vsto

How to trap keypress event in MSword using VSTO?

喜欢而已 提交于 2019-12-18 07:22:50
问题 I am new to VSTO VB.Net programming. and I am developing a word application level Addin and want to trap keypress event. I have tried various codes of hooking but none is working. I want to use application level hook using WH_KEYBOARD instead of WH_KEYBOARD_LL . The following code which I have tried traps just one key stroke after that it stops. Moreover I could not understand where to put trap the keystrokes. How would I use the following for handling key events. Public Event KeyDown As

How to trap keypress event in MSword using VSTO?

霸气de小男生 提交于 2019-12-18 07:22:01
问题 I am new to VSTO VB.Net programming. and I am developing a word application level Addin and want to trap keypress event. I have tried various codes of hooking but none is working. I want to use application level hook using WH_KEYBOARD instead of WH_KEYBOARD_LL . The following code which I have tried traps just one key stroke after that it stops. Moreover I could not understand where to put trap the keystrokes. How would I use the following for handling key events. Public Event KeyDown As

Detect whether MS Office installed is 32bit or 64bit by using registry

本小妞迷上赌 提交于 2019-12-18 06:59:17
问题 I want to install vsto addin based on the excel version (32 bit or 64 bit). I am planning to bundle both 32bit and 64 bit msis and install one by determining the excel version. I am able to find this link to detect whether 2010 office is 32 bit or 64 bit by using registry. Detect whether Office is 32bit or 64bit via the registry But i want to check for excel 2007 and 2013 whether they are 32 bit or 64 bit. Is it possible to detect them via registry. 回答1: First, look for the installed version

VSTO Word post save event

妖精的绣舞 提交于 2019-12-18 05:12:25
问题 Sorry for the length of this, In the past I've been asked before to included everything I've tried when asking these sort of questions. I'm writing a Word Add-in and need to make changes to the document that I cannot achieve using the Word object model. Therefore, after the document is save to disk, I need to capture that event, close the file, do what I need to do and reopen it. (I know, not elegant, but that's what I have to work with.) Word has Before Save and Before Close, but no after

Accessing a VSTO application-addin types from VBA (Excel)

ε祈祈猫儿з 提交于 2019-12-18 03:14:15
问题 We have a VSTO application-addin (not a document-addin) for Excel, and we want to expose an event to VBA code so that the VBA macro can do some action when this event fires in the addin. How can I get the VBA code to be able to subscribe to an event defined in the VSTO application-addin? I'd think that since the addin is loaded in the Excel process, this shouldn't be too tricky, but haven't found a way yet. BTW, using VS 2008 and Excel 2007. Thanks! 回答1: VSTO is not a DLL that can generally

VSTO: invoking on main Excel thread

扶醉桌前 提交于 2019-12-17 22:24:57
问题 I have a button on an Excel sheet which starts a new thread to do some processing. If I want to make any changes to Excel (e.g. write data to a cell using Worksheet.Range("A1").Value = "info"; ), I think I must use the main UI thread. How can this be done? Typically in Winforms I would call Invoke on a control, but the Excel.Application or Worksheet or Range objects don't have an Invoke method. 回答1: That work doesn't 'need' to be done on the UI thread, .net will marshal the call for you, but

How-to: Run existing Word VBA Macros from C# Ribbon Addin

非 Y 不嫁゛ 提交于 2019-12-17 19:53:42
问题 Background: I have an extensive set of specialized VBA macros used in Word for document formatting purposes. In Word 2003, these macros were activated from a customized toolbar. I have recently transitioned to Word 2007 and would like to be able to run these existing VBA macros from a new Word Ribbon created with VS 2010. I have created a Ribbon; however, I cannot figure out how to call the existing macros from the new Ribbon buttons. Question: How do I call the existing VBA macros, which are

Custom Ribbon in VSTO Addin for Outlook 2010 doesn't display

白昼怎懂夜的黑 提交于 2019-12-17 19:28:02
问题 I've got a minimal VSTO Addin for Outlook 2010 with a ribbon. My only goal is to display a ribbon (created via designer) with no functionality. From what little I can tell from MSDN ribbons should just automatically be displayed by default, perhaps with tweaking ControlIdType/CustomId properties for tabs. Alas, tweaking these properties does nothing -- Outlook loads and displays no tab. A simple message box displayed in the ribbon loader reveals it never is triggered. Additionally, I haven't

Cannot perform runtime binding on a null reference - Empty Excel Cells

好久不见. 提交于 2019-12-17 18:58:34
问题 I cannot seem to think of a way to correct the error mentioned in the title and was looking for some ideas on what should be done. I am trying to read the rows of a excel spreadsheet into an object. The first time it loops I have no problems because row 1, column 1 and row 1 column 2 have data in them. But when it gets to row 2, column 1 and row 2 column 2 it falls over with the above error because those cells in spreadsheet are "empty" I just cannot work out where I can put some "if null"

How can I create a (VSTO) Office 2007 add-in using VS 2012?

不羁的心 提交于 2019-12-17 17:38:18
问题 Visual Studio 2012 does not appear to support Office 2007 (it only has project templates for Office 2010). If I want to create an add-in compatible with Office 2007, do I need to use Visual Studio 2010, or is there a simple way to do it with VS 2012? If there is a way to do it in VS 2012, are there any restrictions/advantages, etc. in doing so? 回答1: You can get VS 2012 working with Office 2007 . First create an Outlook 2010 Add-In and modify the project file ( .csproj ) so that it will open