office-2010

Event Handler not being added to new Mail Items

眉间皱痕 提交于 2019-12-31 04:32:12
问题 I'm trying to create a simple Outlook 2010 add-in that responds to new attachment events. The code below only works when I uncomment the MessageBox.Show line. But with it removed it appears not to add the event handler. What am I missing about the program flow that means that a modal message box affect the placement of event handlers? public partial class ThisAddIn { private void ThisAddIn_Startup(object sender, System.EventArgs e) { Application.Inspectors.NewInspector += Inspectors

Set custom document properties with Word interop

我只是一个虾纸丫 提交于 2019-12-28 18:05:25
问题 I want to set some custom document properties of a word document I'm creating in my C# code. To do this, I followed this MSDN article and came up with this code: using Word = Microsoft.Office.Interop.Word; // Version 12.0.0.0 word = new Word.Application(); word.Visible = false; Word._Document doc = word.Documents.Add(ref missing, ref missing, ref missing, ref missing); logger.Info("Setting document properties"); Core.DocumentProperties properties = (Core.DocumentProperties)doc

Is it possible to write a word add-in or something similar to provide a custom mailmerge datasource?

强颜欢笑 提交于 2019-12-25 05:09:33
问题 I've a backend system which I want to use as the datasource for MS Word 2010 mailmerge. I've the idea that I should write a word add-in which provides the datasource and is communicating with my backend over webservices. Is it generally possible to provide a custom datasource with a word add in? Is there a besser solution? Is it possible to do this in C#? Where can I found moar informations about this? Thanks 回答1: The types of data source that Word's out-of-the-box Mailmerge feature can use

Display GAL in Excel to get Alias or Email Adress

僤鯓⒐⒋嵵緔 提交于 2019-12-25 04:27:35
问题 I am trying to make use of information found in THIS POST. I have 2 issues: the following line hangs indefinitly. FIXED--- its just hidden and has no task bar item, simple search told me how to bring to to the front strAddress = objWordApp.GetAddress(, strCode, False, 1, , , True, True).GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3A00001E") I need to return something I can use in a TO line, so an ALIAS or a full email address. I have tested this code in WORD and it works

AppActivate works in Excel 2007 but not in 2010

人盡茶涼 提交于 2019-12-22 18:41:08
问题 I have a excel macro that I run in Excel 2007 and it opens a mainframe application so I can import data from my spreadsheet automatically. This has been working fine, however it doesn't work in Excel 2010. I have tried using the shell command to use the ID but the other application is a mainframe application and non windows based. However, AppActivate "Title" (to open the mainframe application) was working fine in excel 2007. In Excel 2010 I am getting a Run-time error 5 - Invalid procedure

Add controls to existing ribbon group in Office (VSTO)

六月ゝ 毕业季﹏ 提交于 2019-12-22 05:49:27
问题 I find numerous examples on how to add a new group to an existing ribbon, and this works just fine. What I cannot figure out is how I can add new controls to an existing group on an existing ribbon. Say I want to add my own command to the "Proofing" group on the "Review" tab. I'm developing this in VS2010 for Office2010, but I guess the same approach would work on Office 2007 as well. Any pointers or help is appreciated, or if it's not possible to do (without too much hacking) I can live with

Print certain pages only

╄→гoц情女王★ 提交于 2019-12-20 02:32:36
问题 SOLUTION: Application.PrintOut FileName:="", Copies:=2, Range:=wdPrintRangeOfPages, Pages:="2,6-10" ORIGINAL QUESTION: I have the following code which works fine: Application.PrintOut FileName:="", Copies:=2 This prints my 10 page document twice. I now want to use the pages option to specify only certain pages to print out: Application.PrintOut FileName:="", Copies:=2, Pages:="2, 6-10" I was expecting it to print out pages 2 and 6 to 10 twice, i.e. 2,6,7,8,9,10,2,6,7,8,9,10, but instead it

Opening .docx/.docm file inline to <iframe> in IE-8 browser with JSF 2.0 is showing blank iframe with multiple session

て烟熏妆下的殇ゞ 提交于 2019-12-14 03:04:08
问题 I am using <iframe> to open MS Office 2007/2010 document file like docx/docm in a JSF 2.0 project that is deployed at Websphere App Server 8.5, and accessing its url from a client having Windows Server 2008 and MS Office 2010 installed with IE-8 browser. the src of <iframe> is the document url, the example code of <iframe> is exampled here from my .xhtml page. <iframe width = "80%" height = "90%" src = "http://<ip>/files/test.docx"> When we open the respective url with this <iframe>, test

Custom Backstage View Tab like standard tab FileNew

我的梦境 提交于 2019-12-13 06:57:19
问题 I want to design own custom backstage view tab that has desing like standard tab FileNew. How can I (and can I at all) use such tab elements like scrollable button set or large borderless button with text at bottom of one. 回答1: There are elements in the BackStage Tabs which are built-in and not available form the programming side. For example, all the individual controls on the Print Backstage Tab cannot be re-used by a developer. I'm afraid that we have the same problem with the File New

Adding pre-defined Office Ribbon button to custom ribbon in Visual Ribbon Designer

為{幸葍}努か 提交于 2019-12-12 19:43:31
问题 I know how to add existing Office Ribbon items or groups to my custom ribbon using XML ( using idMso tags ) but how do I do this using the Visual Studio Ribbon ( Visual Designer ) technique? Would really rather not have to build the entire thing using XML. 回答1: In Ribbon Designer , you can access the ControlId which points to the idMSO used in Ribbon UI XML . More specifically, ControlId.OfficeId represents the idMSO property that contains the specific Office control identifier. tools.Ribbon