ms-office

VSTO vs. Primary Interop Assemblies, what's the difference?

岁酱吖の 提交于 2019-12-18 13:09:08
问题 I already developed a large Office application-level add-in and it works like a charm, but I have problems understanding the technical basis. So what exactly are VSTO and the PIAs good for? Does VSTO just provide a proper project type for Visual Studio and that's it? Are the Primary Interop Assemblies (PIA) just some kind of wrapper for accessing the Office Object Model ? Do both of them provide more things and features than I am aware of? 回答1: VSTO is the application runtime that provides

VSTO vs. Primary Interop Assemblies, what's the difference?

可紊 提交于 2019-12-18 13:08:41
问题 I already developed a large Office application-level add-in and it works like a charm, but I have problems understanding the technical basis. So what exactly are VSTO and the PIAs good for? Does VSTO just provide a proper project type for Visual Studio and that's it? Are the Primary Interop Assemblies (PIA) just some kind of wrapper for accessing the Office Object Model ? Do both of them provide more things and features than I am aware of? 回答1: VSTO is the application runtime that provides

Proper disposal of COM interop objects in C# particularly MS Office applications

对着背影说爱祢 提交于 2019-12-18 12:58:16
问题 I am developing an application that relies heavily on multiple Microsoft Office products including Access, Excel, Word, PowerPoint and Outlook among others. While doing research on interop I found out that starting with VS2010 and .NET 4, we thankfully no longer have to go through the nightmares of PIAs. Furthermore, I have been reading a lot of articles on proper disposal of objects, the most sensible one seemed to be this one. However, the article is 5 years old and there are not many

“Microsoft.ACE.OLEDB.12.0” cannot be loaded in-process on a 64-bit SQL Server

纵然是瞬间 提交于 2019-12-18 12:19:28
问题 I can not find a solution for this error: The 32-bit OLE DB provider "Microsoft.ACE.OLEDB.12.0" cannot be loaded in-process on a 64-bit SQL Server. I found a lot of posts on the web but none work. I am working with SQL server 2014 64 bits and office 2013 Code that generates the error: SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0 Xml;HDR=YES;Database=C:\SSIS\Table_nm.xlsx', 'SELECT * FROM [Table_nm$]'); 回答1: As it turns out, you can get the 64-bit driver from here. https:/

VBA - How do I remove a file from the recent documents list in excel 2007?

百般思念 提交于 2019-12-18 08:47:12
问题 The recent documents feature in Office is really useful, but I moved a file to a new directory and now I can't get Excel to stop hitting me with a "can't find this file" notification whenever I open a workbook. The Excel options seem only to control how many of these "recent documents" are displayed and not how many are actually saved. So I;'m wondering if there's a way in VBA to get at the list and remove the offending file. 回答1: Try this... Public Function TestIt() For i = 1 To Application

Why do custom file properties, set using the DSOFile library, not persist after saving?

大城市里の小女人 提交于 2019-12-18 08:33:58
问题 I am currently working on a plugin for AutoCAD that allows users to interact with a document versioning application, and in order to sync files between the remote repository and local machine, I had planned on using custom file properties. The properties would be set when a file is initially downloaded, and then persisted for as long as the file remains on the user's local drive. I am not really interested in an AutoCAD-specific solution, because my plugin will deal with files other than

How to obtain PowerPoint File Format Programmatically

ぐ巨炮叔叔 提交于 2019-12-18 07:11:19
问题 I need to determine whether the ActivePresentation is 97-2003 or 2007 format. I really won't want to check the extension. Is there a property somewhere inside the PowerPoint Object Model which gives this info? 回答1: There is no File Format property, unfortunately. You'll have to go the extention route, like: Sub APFileFormat() Dim ap As Presentation Set ap = ActivePresentation Length = Len(ap.Name) Match = InStrRev(StringCheck:=ap.Name, StringMatch:=".") ExtentionLength = Length - Match Select

C#: How to know whether certain Office 2003 or 2007 application is installed?

老子叫甜甜 提交于 2019-12-18 07:05:04
问题 I need to know whether Microsoft Word, Excel, Outlook, Project, etc are installed in a Windows Forms .net 2.0 C# application. The first attempt was by simply trying to create the application objects and catching any exception, but this is too time consuming. Is there any faster way to detect this? Like checking registry values, or another technique with the COM wrappers? 回答1: You can use the MSI (Windows Installer) APIs to find out if the relevant product/package/component codes are present

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

Word table with borders

你说的曾经没有我的故事 提交于 2019-12-18 05:21:21
问题 The following code inserts a table to the Word document: using Word = Microsoft.Office.Interop.Word; ... object oMissing = System.Reflection.Missing.Value; object oEndOfDoc = "\\endofdoc"; Word._Application oWord; Word._Document oDoc; oWord = new Word.Application(); oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing); Word.Table oTable; Word.Range wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range; oTable = oDoc.Tables.Add(wrdRng, 3, 5, ref oMissing, ref