office-interop

Update or refresh Word ContentControls

混江龙づ霸主 提交于 2019-12-13 07:22:28
问题 I have a scenario whereby I need to (programmatically) add ContextControls to a Word table. My example is when a user adds a ContentControl to a table (first cell) then adds a repeating ContentControl to that row - this is perfect! If the user then goes to cell 2 of a 2 cell table (to keep things simple) and adds another ContentControl - keeping in mind this row is already a repeating ContentControl and now just has an additional ContentControl added, the data does not repeat. If I go into my

Excel Interop C# Can't add VBProject Error 800A03EC on Workbook.VBProject.VBComponents.Add(..)

人走茶凉 提交于 2019-12-13 07:17:31
问题 I) Global Explanation Hello, I'm developing an app in C# using Microsoft.Office.Interop.Excel. In my case I implement some olds macros stored in a file to an Excel Workbook, opened by C#, to upgrade them without re-coding macros in my app. Globally there is my process in my app : The user select an updated macro, I check if the macro require something : Here I set the register Key CURRENT_USER\SOFTWARE\Microsoft\Office\[office_ID].0\Excel\Security\AccessVBOM to 1 for allows macro/VBProject

How can I download an Excel file to the user's download folder?

妖精的绣舞 提交于 2019-12-13 06:55:22
问题 In a C#, asp.net 4.0 project, I've created an Excel file using Microsoft.Office.Interop.Excel. The file gets created correctly and is placed in a folder on the server. However, I've been unable to come up with a way to display the file to the client. Can someone help me? Some background: I'm trying to work around the Microsoft change that is blocking Excel files from opening. Our web application uses a Telerik grid and that grid is exported to an Excel file using the ExportToExcel function.

How does the absence of office PIA affect the performance of PowerPoint Add-in?

和自甴很熟 提交于 2019-12-13 05:05:36
问题 I want to know the impact of absence of Microsoft.Office.Interop.PowerPoint dll on the PowerPoint add-in performance. Assume that the launch condition to look for the presence of PIAs on user's machine has been removed during the development of the msi package. Thanks. 回答1: A PIA doesn't have anything to do with performance. It only contains declarations , [ComImport]s for the interfaces and co-classes in the Office object model. The CLR needs them to know how to make a call to them. A PIA

c# asp.net timeout when calling a outlook email

只谈情不闲聊 提交于 2019-12-13 05:00:26
问题 My requirement is that i need to develop a web app , (it is mandatory to be a web app). This app lists the outlook templates that has been saved in a specific directly. Beside each template, there is a load button, you can say a load link if you want When the agent (client) clicks it, the outlook should open with that template. I am trying to open the outlook from my asp.net application. when i click on my button, i execute this code Microsoft.Office.Interop.Outlook._MailItem oMailItem2 =

How to remove html tags from word content?

别说谁变了你拦得住时间么 提交于 2019-12-13 04:33:34
问题 I know there are a couple threads about it which says simply using Regex.Replace(input, "<.*?>", String.Empty); but I cant use it in text written in word doc. my code is like: Microsoft.Office.Interop.Word.Document wBelge = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing); Microsoft.Office.Interop.Word.Paragraph paragraf2; paragraf2 = wBelge.Paragraphs.Add(ref oMissing); paragraf2.Range.Text ="some long text"; I can change with finding and replacing like Word.Find

Create isolated Interop.Word instance

纵然是瞬间 提交于 2019-12-13 04:25:23
问题 I need to create documents in background via Interop.Word. When I get new instance of _Application, it creates new WINWORD process with svchost.exe process as parent and sets Window visibility to Hidden. But when I open Word document manually, it opens in a process created by App, but not in a new process. Also it makes hidden Word app with all opened documents in background earlier visible. Is it possible to deny Word app created by me in code to use documents opened\created by user manually

C# to get second paragraph in a list item of a Microsoft.Office.Interop.Word.List

冷暖自知 提交于 2019-12-13 04:08:13
问题 Using C# I am trying to get all list items of a list in a Microsoft WORD document. The document has only one list as shown below. And the third item of the list contains a second paragraph. Question : Following code is not getting the second paragraph of the third item of the list. What I may be missing and how can we get the second paragraph in the output (shown below)? NOTE : I'm using C# but a VBA solution will also be fine. Snapshot of WORD document : Code : Using System using Word =

C# Microsoft.Office.Interop.Word protect the paragraph

孤人 提交于 2019-12-13 03:42:22
问题 I'm using Microsoft.Office.Interop.Word with C#. I know that you can set modification restricted for a specific paragraph. Example Paragraph1 you can’t modify Paragraph2 you can edit Paragraph3 you can’t modify The issue I am having in the code is it is protecting the first paragraph, but after that users are able to modify the other paragraph, please check the codes Thanks public string ExtractText() { var app = new Microsoft.Office.Interop.Word.Application(); Document document = app

HTML to Doc : Add minimum space between tables

时光总嘲笑我的痴心妄想 提交于 2019-12-13 03:38:12
问题 I am generating word doc from HTML content using Microsoft.Office.Interop.Word dll. Word doc file is generated properly. but I am getting much padding space issue. I have two tables and I want to give a minimum space between two tables. I have tried to apply padding and margin on the table but both are not working. If I place an extra line then it is showing much space between two tables. Is there any way to give minimum space between tables? Result if we add a line between two tables. Result