interop

How to apply a Word Quick Style in C# - not just simple formatting but the entire style?

这一生的挚爱 提交于 2019-12-23 08:26:25
问题 I admit, I am very new to using the Interop libraries, but the advice people always seem to give is, record a macro and check out the vba code. The problem is, the macro does not record exactly what I am doing: Clicking a Quick Style to apply it to the current selection . My task is pretty simple: I need to apply a Quick Style to a Paragraph ( Microsoft.Office.Interop.Word.Paragraph ) . Using the set_style command however, only applies basic formatting, and the paragraph keeps it original

Importing Excel Charts from Excel to PowerPoint causes `RPC_E_SERVERFAULT` on some machines

本小妞迷上赌 提交于 2019-12-23 04:57:08
问题 This is an irritating one. I have created a method to copy all Excel charts in a workbook to PowerPoint slides. public int ImportExcelChartsFromWorkbookToSlides(int startingSlideIndex, string workbookPath, string[] slideTitles, int chartPosTop, int chartPosLeft = 10, int titleWidth = 680, int titleHeight = 20, int titlePosTop = 90, int titlePosLeft = 20, int titleFontSize = 18) { int slideIndex = startingSlideIndex; int titleIndex = 0; EXCL.Application objExclApp = new EXCL.Application();

WiX register assemblies for COM Interop

拜拜、爱过 提交于 2019-12-23 04:43:33
问题 I'm really struggling with WiX. I have .NET assemblies to install that require registration for COM Interop, AND they must be registered with another framework that requires calling a Register() method in a .NET assembly that's in the GAC. This registration method is a 'black box' with a hidden storage mechanism so I can't perform this operation declaratively. I get that the declaritive approach is best for COM registration, but I have two problems with using heat.exe: RegAsm works, but Heat

Create GUI in C# and call in VBScript

為{幸葍}努か 提交于 2019-12-23 04:42:18
问题 I try to make an ActiveX by C# with COM-visible. It is a Windows Form. I built it successfully as a dll ActiveX, then I wrote a VBScript code to call it. The from appeared but disappeared right after that. I don't know why @@ Here is my code: C# code using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; using Microsoft.Win32; using System

AutoCorrect Text C# Word

白昼怎懂夜的黑 提交于 2019-12-23 04:28:14
问题 I'm trying to use word to automatically correct some text that is not in English the problem is that when i use the SpellCheck function the "Spell and Grammar" dialog box pop-up and waits for users input and i want the text to be corrected automatically. So my question is how do i solve this ? using System.Collections.Generic; using Microsoft.Office.Interop.Word; using Word = Microsoft.Office.Interop.Word; using TobyCL.ro.toby.StringOperations; namespace namespace.ro.toby { class WordProofing

Fastest way to read from and write to Excel using C# [duplicate]

余生颓废 提交于 2019-12-23 04:24:22
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: What is the best / fastest way to export large set of data from C# to excel I am creating a web application with the following functionality: Assume an admin stores some data in a predefined Excel template file. He will visit the Admin page and upload this Excel. The application reads this Excel and updates data in the database accordingly. The data stored in the database has to be displayed to any user visiting

Open Word document, unless it has password with C#

我是研究僧i 提交于 2019-12-23 03:35:19
问题 The thing i am trying to do is run through folders of word documents and convert them to .tif files using a tiff printer in word. The problem is, if i run into a document, with a password it should skip the document without prompting to ask for password, it should all remain in background. I can see that the Document class have a HasPassword property, but it cannot be checked before the document is opened. word.Documents.OpenNoRepairDialog(@"c:\testfolder\testDocWithPw.docx", ReadOnly: true);

tlbimp.exe converts HWND to _RemotableHandle

巧了我就是萌 提交于 2019-12-23 03:17:09
问题 Our COM component interface has the next method: HRESULT CreatePluginWindow([in] HWND hParent, [in] RECT* prcView); We are going to use it in .NET application but interop for this interface is looking like this: void CreatePluginWindow(ref interop.alfrontx._RemotableHandle hParent, ref interop.alfrontx.tagRECT prcView) According my investigation there is no way to use this method without unsafe code. I'd not like to change COM interface in order to use other than HWND type for hParent,

LinqToExcel: Distinct values in excel column

时光总嘲笑我的痴心妄想 提交于 2019-12-23 03:13:06
问题 This might be a very simple thing for you gurus, but I'm not familiar with C#4 and INTEROP. Therefore, I'm stumped. Here's my problem. I have a excel column that has duplicate data and I want to trim it down to only unique values. Here's what the data looks like: ColA ColB 10 Adam 12 Jane 14 Adam 18 Adam 20 Eve So, in the end I just want unique names from ColB: Adam Jane Eve I know that I can do this by getting all those values into a List and then adding the Distinct functionality to it. But

SoapUI request to WCF service fails using certificates

落花浮王杯 提交于 2019-12-23 03:00:16
问题 I have a custom binding like following for my WCF service which I am trying to call from the soapUI 4.5.1 <customBinding> <binding name="NewBinding0"> <transactionFlow /> <security authenticationMode="MutualCertificate" defaultAlgorithmSuite="Basic128" securityHeaderLayout="Lax" includeTimestamp="false" messageProtectionOrder="SignBeforeEncrypt" allowInsecureTransport="true" requireSignatureConfirmation="false" requireDerivedKeys="false" keyEntropyMode="ClientEntropy"