office-interop

Spax EA best way to export diagrams into Word document

爷,独闯天下 提交于 2019-12-12 04:20:02
问题 Got an old module which is generates reports with data from sparx ea project. There is a part where you need to insert diagrams as pictures in the document. Now it looks like that public static void copyDiagram( EA.Diagram diagram, EA.Repository eaRepository) { eaRepository.App.Project.PutDiagramImageOnClipboard(diagram.DiagramGUID, 0); eaRepository.CloseDiagram(diagram.DiagramID); } copying it to clipboard, and after that there goes something like currentDocumentRange.Paste() Looks strange

C# Save PPT Shape (msoPicture) as Image w/ Office.Interop

六月ゝ 毕业季﹏ 提交于 2019-12-12 03:57:45
问题 I have a PPT slide deck with multiple images. I am iterating through each slide and each shape. I would like to save each shape of type msoPicture as an Image: foreach (PPT.Slide slide in pptDoc.Slides) { foreach (PPT.Shape shape in slide.Shapes) { if (shape.Type == Microsoft.Office.Core.MsoShapeType.msoPicture) { Image img; //???? Save shape as image img.Save(filename); } } } 回答1: You can use the Shape.Export() method to create an image from an individual shape. For example like this:

Accessing Interop.office.excel library from asp.net web application

吃可爱长大的小学妹 提交于 2019-12-12 03:19:24
问题 i have an asp.net web application and deployed on web server. in a scenario i have a fixed format excel sheet which is on server in a web folder. at runtime i m writing in cell with the help of interop.office.excel library. initially there was no excel installed on server then we have installed excel and given COM component full rights from Component services. but now we are getting below error. How to solve this ? Detection of product '{90110409-6000-11D3-8CFE-0150048383C9}', feature

C# Excel Write to multiple cells

北城余情 提交于 2019-12-12 03:01:36
问题 Hi i try to get better with the c# excel stuff. Right now i try to select some values from an existing excelsheet. For Example: From B4 to C16. So i can replace the values with something else but i dont get it to work. This is my little method: public void writeExcelFile() { string path = @"C:\Users\AAN\Documents\Visual Studio 2015\Projects\WorkWithExcel\WorkWithExcel\bin\Debug\PROJEKTSTATUS_GESAMT_neues_Layout.xlsm"; oXL = new Excel.Application(); oXL.Visible = true; oXL.DisplayAlerts =

Office Interop Issue on Windows Server

偶尔善良 提交于 2019-12-12 02:41:38
问题 I am trying to access the Word Office Interop on a server from my aplication using the following line: Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application(); This however causes an exception to be throw: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). Does anyone know what I can do to

Why setting OLEDBConnection.Connection throws Exception (HRESULT: 0x800A03EC)?

独自空忆成欢 提交于 2019-12-12 02:39:10
问题 I am working with Excel Interop namespace to modify connection string in the Excel Workbook connections. Why when I am trying to set the connection property (MSDN OLEDBConnection.Connection) throws an error on the line of the assignment? Exception from HRESULT: 0x800A03EC application = new Application(); Workbook wb = application.Workbooks.Open(file.FullName); Sheets wbs = wb.Worksheets; IEnumerable<Workbook> workbooks = application.Workbooks.Cast<Workbook>(); foreach (var connection in wb

Cannot ungroup a PowerPoint SmartArt Shape

家住魔仙堡 提交于 2019-12-12 01:58:39
问题 I try to ungroup a SmartArt shape from code, but it always causes an error: "This member can only be accessed for a group". However, it's working, if I right click on the SmartArt shape, and ungroup it. How can I fix this? My code is: public void CreateSmartArt(PowerPoint.Shapes allShapes) { PowerPoint.Shape smartartShape = allShapes.AddSmartArt(IttPowerPoint.Instance.PowerPointApp.SmartArtLayouts["MyLayOut"], 0f, 0f, width, height); Marshal.ReleaseComObject(smartartShape); smartartShape =

F# Excel UsedRange is not Defined

巧了我就是萌 提交于 2019-12-12 01:15:51
问题 Error: "The field, constructor or member 'UsedRange' is not defined". Code excerpts: open Microsoft.Office.Interop.Excel open Microsoft.Office.Tools.Excel // Onorio's excellent suggestion didn't fix code until this line was added. // Once the above line was added, Onorio's suggestion worked, // but now F# says "The field, constructor or member 'EntireColumn' is not defined". let xl = ApplicationClass() xl.Workbooks.OpenText(... let wb = xl.Workbooks.Item(1) let ws = wb.ActiveSheet :?>

How to read Math Equations from Powerpoint and write it to Word document in C#

随声附和 提交于 2019-12-12 00:08:43
问题 I am developing a PowerPoint extraction tool since march 2014 which extracts the words or paragraphs from PowerPoint and write it to word document. It has been developed. During the testing. we found that Math Equation has not being fetched from PowerPoint slide. I am using Microsoft.Office.Interop.Powerpoint.dll library. i am reading file such as given below. var powerPoint = new Application {WindowState=PpWindowState.ppWindowMinimized}; var oPresSet = powerPoint.Presentations; Microsoft

C# Word Interop Saving docx with Word 2003 + Compatibility Pack

橙三吉。 提交于 2019-12-11 23:38:21
问题 On my dev machine, I have office 2007 installed on Win7 x64. The target machines are Office 2003 + Compatibility Pack (to read/write docx, etc.) running on WinXP x64. My program does, among other things, open/save as commands on doc files, converting them to docx. It runs wonderfully on my machine, but sadly gives zero-sized files on the target machines. No exceptions are thrown, it looks like it's working fine except when I look at the output file, it's zero-length. Any ideas why this is