ms-word

VB .NET automation, Document.SaveAs corrupting Word Document

。_饼干妹妹 提交于 2020-01-22 02:26:08
问题 Just to start I try to summarize what I want to do: My vb .net app done in vs2019 simply automates and fills a word template, it should at the end save it in a folder provided by a text box saved in the variable URL. Everything is fine and dandy but if I try to open the word docx I get this: . Also if I save using the saveAs from word itself,manually, the file isn't corrupted anymore. And there is difference in size between the files that are pretty much the same: . . . SO, the file "Adresa

How to get range of the text in Word document programmatically in MS Office Word add-in using JS API [duplicate]

情到浓时终转凉″ 提交于 2020-01-22 02:16:18
问题 This question already exists : Get range of the text in Word document programmatically in MS Office Word add-in using JS API [closed] Closed 20 days ago . I need to get numerical range of the text(example: startpoint-30, endpoint-35) in word document programmatically (via MS Office add-in), but I can't find how to do that via JS. Here is an example: Hello my friend Pete, I talked to your friend Robert yesterday and he told about his friend Ann. So, I need to get range of any word i want and

How to get coordinates of Run or other WordProcessing element via OpenXML?

天涯浪子 提交于 2020-01-22 02:14:47
问题 I was wondering if it is possible to find the coordinates of a specific Run (text, no drawing or other elements that have offset parameter) on a page in a Word document using OpenXML SDK . I know that OpenXML is basically .. well XML, and simple runs have no relative, numerical position embedded in them. I was reading through OpenXML SDK API and found no clues but maybe I have missed something. By coordinates I mean any tuple that can be mapped to pixels if I would generated an image out of

Script for changing fonts in a Word document

眉间皱痕 提交于 2020-01-21 19:39:40
问题 I have a Word 2007 file and I want to change all usage of the Courier New font into a Lucida Console font. I need a script that find all words formatted in that font and change it to the new font. How can I do that? 回答1: Inside Word, you can record a macro by doing it yourself. Then you open the VBA editor, optionally remove some useless thing (usually too many selections or moves within the file) and you've got your script. Edited: moved the contents of a comment here, to answer the author's

Converting a <V:shape>/Embed to a w:drawing

淺唱寂寞╮ 提交于 2020-01-21 19:14:36
问题 I have a V:Shape that I am assuming has come from the conversion of a .Doc file to a .Docx file, but in the code I have written, I am wanting a DocumentFormat.OpenXml.Drawing.Pictures.Picture . Is there any way to programically convert to a Picture ? The snippet I'm using is: foreach (var item in value) { if (!item.Descendants<Picture>().Any()) //pictures are processed differently - they're an absolute s**t storm to code... { p.Append(item.CloneNode(true)); } else { p.Append(CreateImageRun

Viewing .doc file with java applet

耗尽温柔 提交于 2020-01-21 07:22:31
问题 I have a web application. I've generated MS Word document in xml format (Word 2003 XML Document) on server side. I need to show this document to a user on a client side using some kind of viewer. So, question is: what libraries I can use to solve this problem? I need an API to view word document on client side using java . 回答1: You cannot reliably display a Word document in a web page using Java (or any other simple technology for that matter). There are several commercial libraries out there

Find and Replace with Regex in Microsoft Word 2013

寵の児 提交于 2020-01-21 02:38:11
问题 I am editing an e-book document with a lot of unnecessary markup. I have a number of sections in the text with code similar to this: <i>Some text here</i> I am trying to run a regex find and replace that will find any phrase between the two i-tags, remove the i-tags, and apply a style to the text. Here is what I'm using to search: Find: (<i>)(*)(</i>) Replace: \2 I'm also selecting Styles > i (for italic). This tells our conversion software to apply italics to the text. If I leave the i-tags,

How can I form a Word document using stream of bytes

橙三吉。 提交于 2020-01-20 08:06:49
问题 I have a stream of bytes which actually (if put right) will form a valid Word file, I need to convert this stream into a Word file without writing it to disk, I take the original stream from SQL Server database table: ID Name FileData ---------------------------------------- 1 Word1 292jf2jf2ofm29fj29fj29fj29f2jf29efj29fj2f9 (actual file data) the FileData field carries the data. Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application(); Microsoft.Office

Interop.Word Documents.Open is null

穿精又带淫゛_ 提交于 2020-01-18 15:46:50
问题 I am trying to open .docx file and convert to PDF using Interop.Word.Application. It works as console application but If I use the same in my web application it doesn't work. I tried to see the permissions on the folder. I gave 'Network Service' with full control, but still I get object reference not set at word.Documents.Open. Could you please let me know what could be the problem? I am stuck with this error. Please let me know. I appreciate any suggestions. Thank you. Microsoft.Office

Interop.Word Documents.Open is null

懵懂的女人 提交于 2020-01-18 15:44:13
问题 I am trying to open .docx file and convert to PDF using Interop.Word.Application. It works as console application but If I use the same in my web application it doesn't work. I tried to see the permissions on the folder. I gave 'Network Service' with full control, but still I get object reference not set at word.Documents.Open. Could you please let me know what could be the problem? I am stuck with this error. Please let me know. I appreciate any suggestions. Thank you. Microsoft.Office