ms-office

Exporting data to excel file C#.NET

狂风中的少年 提交于 2019-12-12 20:27:15
问题 I want to export the data from a access database to excel file. But i got Exception from HRESULT: 0x800A03EC error. Here is a bit of code that i have written, using System; using System.Data; using System.Data.OleDb; using System.Configuration; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Text; using System.Windows.Forms; using Excel = Microsoft.Office.Interop.Excel; private void showBtn_Click(object sender, EventArgs e) { int cnt = -1;

Office integration (Word) - intercepting save

自闭症网瘾萝莉.ら 提交于 2019-12-12 20:02:16
问题 I am planning to implement a small in-house document management system. It must have a web GUI for managing a remote folder structure stored in a database. In these folders are word documents stored (physically as blob in a database). Whenever a user clicks on a document link, a word binary is downloaded via browser and (hopefully) opened in Word on the user's PC. This is the easy part ;) Now the user hits "Save" or Ctrl-S. I want to have a functionality programmed inside Word that calls a

Worksheet function for division of real numbers (ie, /)

心不动则不痛 提交于 2019-12-12 19:22:31
问题 I have not found division of real numbers (ie, / ) in worksheet functions. As a consequence, to evaluate =SUM(2,SUM(30,40)/3) , we cannot use one expression ctx.workbook.functions.sum(1,ctx.workbook.functions.sum(30,40)/3) ; we have to do ctx.sync two times: function test () { Excel.run(function (ctx) { var result = ctx.workbook.functions.sum(30,40); var result2; result.load(); return ctx.sync() .then(function () { result2 = ctx.workbook.functions.sum(1,result.value/3); result2.load(); })

How to set default browser for an add-in

自古美人都是妖i 提交于 2019-12-12 19:16:11
问题 I am trying to set default browser for the add-in I am using to chrome, but by default it takes IE always. How do I change this 回答1: I assume you are talking about a scenario where your add-in generates a new browser window/popup. On Windows, this will always be Internet Explorer. Keep in mind that for all Office desktop variants, add-ins are hosted within an embedded browser instance. For Windows machines, this is an embedded Internet Explorer instance. For Mac machines, it uses an embedded

NullReferenceException when use Office 365 API in Xamarin.IOS

痴心易碎 提交于 2019-12-12 17:22:34
问题 First I got this issue: Using Office 365 API in Xamarin.Android Now testing the same in Xamarin IOS I got another :( {System.NullReferenceException: Object reference not set to an instance of an object at Microsoft.Office365.OAuth.Authenticator.GetRefreshToken (System.String resource) [0x00000] in <filename unknown>:0 at Microsoft.Office365.OAuth.Authenticator+<GetAuthenticationResult>d__c.MoveNext () [0x00000] in <filename unknown>:0 --- End of stack trace from previous location where

window.opener does not work in Excel for Windows

旧巷老猫 提交于 2019-12-12 16:41:01
问题 I have built an Excel add-in, it opens a popup by window.open , then the add-in communicates with the popup site. I just realised that it does NOT work in Excel for Windows, the reason is that the popup can NOT get the host by $window.opener . To illustrate this and avoid cross-domain, I have made a xml, which refers to the add-in and the test page. It works well in Excel Online in Chrome and in IE. However, while running it in Excel for Windows, $window.opener returns undefined . Could

C# code to find all office updates installed

痞子三分冷 提交于 2019-12-12 15:27:14
问题 In add or remove programs you can view list of updates/patches for MS office Outlook. Is there a way to get this information using c# code. We tried WMI code const string query = "SELECT HotFixID FROM Win32_QuickFixEngineering"; var search = new ManagementObjectSearcher(query); var collection = search.Get(); foreach (ManagementObject quickFix in collection) Console.WriteLine(quickFix["HotFixID"].ToString()); This only lists windows updates. Is there a way to list updates for office components

Automatically loading Word Task Pane Office Add-in

六月ゝ 毕业季﹏ 提交于 2019-12-12 12:23:31
问题 We are developing a Word Task Pane Office Add-in (not VSTO) for internal organization documents In Word 2013 (desktop) when we insert the add-in and save the document, when we reopen that document the add-in is automatically loaded. In Word Online, this behavior is different, the add-in doesn't get automatically loaded. The user has to manually insert the add-in every time the document is opened. Is there a way to automatically load it in Word Online? Would running our own Office Web App

Creating a nested field with Word.Interop

僤鯓⒐⒋嵵緔 提交于 2019-12-12 09:55:17
问题 I'm playing around with VSTO, more precisely with C# and a "Microsoft Word" application add-in, at the moment. I do want to programmatically create nested fields. I've come up with the following source code (for testing purposes): public partial class ThisAddIn { private void ThisAddIn_Startup(object sender, EventArgs e) { // TODO This is just a test. this.AddDocPropertyFieldWithinInsertTextField("Author", ".\\\\FileName.docx"); } private void AddDocPropertyFieldWithinInsertTextField(string

'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine though Microsoft.ACE.OLEDB.12.0 is installed

本秂侑毒 提交于 2019-12-12 09:23:12
问题 I get the following exception 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine though I have installed 'Microsoft.ACE.OLEDB.12.0' In my local dev machine I have also office 2010 What is wrong? 回答1: If you system is 64 bit,Then you have to change your pool settings to allow 32 bit applications that is OLEDB. ,then this link might help. http://help.webcontrolcenter.com/KB/a1114/how-to-enable-32-bit-application-pool-iis-7-dedicatedvps.aspx 回答2: refer posts it was