ms-office

Is Microsoft.Office.Interop safe to use for (file-converting) for a website?

那年仲夏 提交于 2019-12-02 01:41:13
问题 I am coding a website on witch users have to add reports (Word document's) and to make possible to view them I convert *.doc to *.pdf, and then displaying them throught pdf.js. For converting i use Microsoft.Office.Interop.Word. Code looks like public void ConvertDocument(string PATH) { FileInfo FILE = new FileInfo(PATH); if (FILE.Extension.ToLower() == ".doc" || FILE.Extension.ToLower() == ".docx" || FILE.Extension.ToLower() == ".docm" || FILE.Extension.ToLower() == ".dotx" || FILE.Extension

Is there a way to programmatically add a digital signature to a VBA Macro in a word document?

三世轮回 提交于 2019-12-02 01:12:05
Is there a way to programmatically add a digital signature to a VBA Macro in a word document using C# or VB.Net? There are some similar questions asked already; however, none that I could find answer my question: How to programmatically remove the digital signature from VBA macros in Excel? Digital Signature for Excel Macro Unfortunately, there isn't an automation API for this in the VBA environment. I got it working 100% unattended (so I could use it in automated builds) by P/Invoking Win32 APIs to grab the right window handles and simulate the keyboard shortcuts to those windows, highlight

Documents.Add fails on ASP.NET (VB.NET)

依然范特西╮ 提交于 2019-12-02 00:40:33
问题 I am having an issue with opening a document using Microsoft Word from ASP.NET MVC. This works perfectly on my developer machine, but not when deployed to IIS. Dim word = New Microsoft.Office.Interop.Word.Application 'This line is failing to return a document object Dim letter = word.Documents.Add(letter_doc_path) 'This line then fails due to [letter] being null letter.MailMerge.OpenDataSource(csvPath) I have added permissions in "Component Services" (dcomcnfg) to the NETWORK SERVICE user

Is Microsoft.Office.Interop safe to use for (file-converting) for a website?

一世执手 提交于 2019-12-01 23:26:34
I am coding a website on witch users have to add reports (Word document's) and to make possible to view them I convert *.doc to *.pdf, and then displaying them throught pdf.js. For converting i use Microsoft.Office.Interop.Word. Code looks like public void ConvertDocument(string PATH) { FileInfo FILE = new FileInfo(PATH); if (FILE.Extension.ToLower() == ".doc" || FILE.Extension.ToLower() == ".docx" || FILE.Extension.ToLower() == ".docm" || FILE.Extension.ToLower() == ".dotx" || FILE.Extension.ToLower() == ".dotm") { if (FILE.Length == 0) { return; } object oMissing = System.Reflection.Missing

Does Office Starter include the DLLs for Microsoft.Office.Interop?

坚强是说给别人听的谎言 提交于 2019-12-01 23:24:52
I want to use Microsoft.Office.Interop.Excel to pull some data out of an XLS file. I have Visual Studio 2010 and the Office Developer Tools installed. However, I am getting a COMException error at var app = new Application(); when the program runs. Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). I have Office Starter 2010 installed. Is it the case that I can't use the Interop libraries unless I have the full version of

How can I see if a Word-file is password-protected?

倾然丶 夕夏残阳落幕 提交于 2019-12-01 22:19:12
问题 I am maintaing an archiving system that has to convert various kinds of document formats to tif. My problem is with password-protected Word-documents. If the document is password-protected, then Word responds with a popup asking me to enter the password. It's ok if the document is password-protected if I can just tell the customer that he needs to do something about it. The problem is that I programmatically cannot register if Word is prompting for a password. The code below is the standard

Overlay item for all slides in PowerPoint

不羁的心 提交于 2019-12-01 22:08:36
问题 I want to make a PowerPoint add-in to show some small html+css component on each slide, and not by adding add-in every time I'm adding a new slide. What should I look for and could it be done with some office add-ins and commands APIs? 回答1: In PowerPoint, the way to add content that's repeated on every slide is called Slide Master (View > Slide Master). Unfortunately, content add-ins in the Slide Master view show only the static image of the add-in, not live HTML+CSS. So there's no way to put

Accessing CustomProperties on Worksheet with Name

给你一囗甜甜゛ 提交于 2019-12-01 21:47:13
I'm trying to access a custom property on a worksheet by using the name of the property, but it seems this is not supported (at least not in C#, I saw others reporting that it works in VB and documentation also says so). Can someone confirm that this is not working in C#? Here is example code: activeWorkSheet.CustomProperties.Add("Test", 123); // Accessing by index works, but by name it doesn't. // The documentation says access by name should be possible var works = activeWorkSheet.CustomProperties.Item[1].Value; var doenstWork = activeWorkSheet.CustomProperties.Item["Test"].Value; I know that

Overlay item for all slides in PowerPoint

↘锁芯ラ 提交于 2019-12-01 21:27:11
I want to make a PowerPoint add-in to show some small html+css component on each slide, and not by adding add-in every time I'm adding a new slide. What should I look for and could it be done with some office add-ins and commands APIs? In PowerPoint, the way to add content that's repeated on every slide is called Slide Master (View > Slide Master). Unfortunately, content add-ins in the Slide Master view show only the static image of the add-in, not live HTML+CSS. So there's no way to put live HTML+CSS on every slide with a single operation, but if all the user needs is the image of the content

Reading .doc file without launching MSWord

梦想与她 提交于 2019-12-01 19:46:30
I'm trying to open .doc file and read its content. But i can't find any way how to do this without launching MSWord. Now I have following code: Microsoft.Office.Interop.Word.Application app = new Microsoft.Office.Interop.Word.Application(); object nullObject = System.Reflection.Missing.Value; object file = @"C:\doc.doc"; Microsoft.Office.Interop.Word.Document doc = app.Documents.Open(ref file, ref nullObject, ref nullObject, ref nullObject, ref nullObject, ref nullObject, ref nullObject, ref nullObject, ref nullObject, ref nullObject, ref nullObject, ref nullObject, ref nullObject, ref