office-interop

Edit Excel Spreadsheet object in word document (C# Interop)

送分小仙女□ 提交于 2019-12-14 01:56:15
问题 I am currently trying to edit cells of an excel spreadsheet object with c# interop. I inserted it in a word document as an object. Until there i didn't succeed to programm anything that really works. I'm able to select the component but i can't open it to edition and then reach grid's cells. I use a button control in a custom office ribbon to launch edit. Here is my method: public void EditTable(Office.IRibbonControl control) { Word.Application oWordApp = (Word.Application)Marshal

Primitive MailMerge using just delimited field names

▼魔方 西西 提交于 2019-12-14 01:35:30
问题 Obviously the correct way for our app to generate a Word document based on a template is to encourage the admin users (who will look after the templates) to embed the correct merge fields or bookmarks in the template document. However in the past we have found our typical admin user who ordinarily doesn't use MailMerge or any of the other "advanced" features in Word is significantly put off by having to use merge fields. We have tried doing it for them, producing documentation, lots of

object of Interop Word Document Class is null on Windows Server 2008 - Word Open method

给你一囗甜甜゛ 提交于 2019-12-13 18:45:49
问题 While I am opening word document and saving it on my machine its working fine, but when I am uploading it on server and opening it there, It is going in if (doc == null) block, it should not go. Please update my question title if its not relevant or ask for any clarification. Here is my class: using System; using System.Collections.Generic; using System.Web; using Microsoft.Office.Interop.Word; /// <summary> /// Summary description for ClsWordExManager /// </summary> public class

Issue with converting DOC to PNG

无人久伴 提交于 2019-12-13 17:05:16
问题 I have a strange issue. I have .dot file that I populate and turn to .doc file. I then take this .doc file and turn it into an image. Problem is, the image is perfect on localhost (high quality) and very poor quality on live server. My question is, how can I save a high quality .png (or any other) image instead of a low quality one? It's just bizarre because the same code works on localhost but fails on live server. Here is the conversion method I am using: private void ConvertDocToPNG(string

MS Office Interop for OS X

淺唱寂寞╮ 提交于 2019-12-13 14:25:09
问题 I've been searching high and low for information on interop with the Mac versions of Office (specifically, PowerPoint). I haven't been able to find any documentation on what APIs are available, or even what protocol is used to access them... (something like COM? Apple-native automation APIs? something else entirely?) It seems like it is possible, though. Various "PowerPoint remote control" apps exist for Mac that are able to make a running instance of PowerPoint switch slides, and even seem

ApplicationClass Documents.Open returns null for ASP.NET site on 64bit system

旧时模样 提交于 2019-12-13 14:07:42
问题 I have a problem with opening word document from ASP.NET site. The solution works fine on Windows 2003 Server, but doesn't work on Windows 2008 server x64 and Windows 7 x64. To simplify the solution I've created an ASP.NET MVC 3 site and try to open word document from there. Environment I have: Windows 7 x64 and MS Office 2010 x64 The code for opening adocument is the following: public ActionResult WordTest() { var fullFileName = @"C:\inetpub\wwwroot\fpub\TestDocument.docx"; var impersonation

Adding image from folder to dropdown list

血红的双手。 提交于 2019-12-13 10:17:11
问题 I want to add images from folder and list it in dropdown . Like my application has folder name flags containing all the flags images and their country name. how do I add them to dropdown . 回答1: Try using the System.IO.Directory.GetFiles and System.IO.Path.GetFileName http://msdn.microsoft.com/en-us/library/system.io.directory.getfiles(v=vs.110).aspx http://msdn.microsoft.com/en-us/library/system.io.path.getfilename(v=vs.110).aspx Something like (haven't tried it) // Process the list of files

Change sheet source dynamically

拟墨画扇 提交于 2019-12-13 09:49:03
问题 How to change Excel sheet source dynamically depending on particular values? I am developing an Excel sheet. Depending on one dropdown value, fields of other dropdown should change dynamically. Suppose I choose one value from dropdown1, dropdown2 should get certain column from "Sheet2" and if I choose another value from dropdown1, dropdown2 should get certain column from suppose "Sheet". How can I achieve this? This should be related to Excel formulas I guess. 回答1: Just follow this tutorial

How to show a waiting dialog, in the meantime, still keep dealing with PowerPoint objects?

白昼怎懂夜的黑 提交于 2019-12-13 07:30:58
问题 I want to show a waiting dialog, in the meantime all the calculations concerning with PowerPoint objects still are running in the background. My purpose is during the time dealing with PowerPoint objects, I try to prevent the user from interfering with the UI. It seems that there is no way to deal with PowerPoint objects in the background. Is there any workaround for my case? Thanks Note: I am using VS Ultimate 2013, C#, PowerPoint 2013, vsto 回答1: Office applications use the single threaded

Add If condition in footer using Word Interop in C#

痴心易碎 提交于 2019-12-13 07:23:52
问题 I am using visual studio express 2015 and word interop 14.0. I need to add a If condition in the footer of the last page of a word document using Word Interop in C#. I searched for the code and also in other forums, but couldn't get it work in C#. Please help. My question is how to add a IF condition in the footer section so that it only dipslays in the last page. condition is: if page = numpages then "Last Page Footer Text" else "Other page footer text" I used the below code, but it displays