ms-word

How to generate Word document(doc,docx) in ASP.NET? [closed]

ε祈祈猫儿з 提交于 2020-01-09 10:31:51
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . How to generate Word document(doc,docx) in ASP.NET? 回答1: You can create OpenXML documents using the Open XML SDK 2.0 for Microsoft Office. Note that this only applies to .docx , not .doc binary files from earlier versions of Word. Documentation can be found here. 回答2: You can use

Open word from excel

喜夏-厌秋 提交于 2020-01-09 08:14:04
问题 I can't open Word from Excel macro (Office XP). If I use this code, it will stop on line Set wdDoc = wordapp.Documents.Open(polozka.ShortPath) and program freezes. If I use Set wdDoc = GetObject(polozka.ShortPath) instead of this line, program stops here With wdDoc.Selection with error: "Object doesn't support this property" Dim wordapp As Word.Application Dim wdDoc As Word.Document Set fso = CreateObject("Scripting.FileSystemObject") Set files = fso.GetFolder("C:\path").Files Set wordapp =

Open word from excel

混江龙づ霸主 提交于 2020-01-09 08:13:09
问题 I can't open Word from Excel macro (Office XP). If I use this code, it will stop on line Set wdDoc = wordapp.Documents.Open(polozka.ShortPath) and program freezes. If I use Set wdDoc = GetObject(polozka.ShortPath) instead of this line, program stops here With wdDoc.Selection with error: "Object doesn't support this property" Dim wordapp As Word.Application Dim wdDoc As Word.Document Set fso = CreateObject("Scripting.FileSystemObject") Set files = fso.GetFolder("C:\path").Files Set wordapp =

Navigating Rich Text Control in OpenXml

て烟熏妆下的殇ゞ 提交于 2020-01-07 09:04:07
问题 I'm working with OpenXml and C#, I'm was using bookmarks but now might be switching over to Rich Text Controls. I was able to locate and work with the bookmarks, but i'm having some issues locating the Rich Text Controls. I'm trying the below: IEnumerable<SdtBlock> contentControlsDoc = null; ((MainDocumentPart)section).Document.Body.Descendants<SdtBlock>(); foreach (var contentControl in contentControlsDoc) { } I'm able to get 1 control, but sometimes I have a Rich Text Control within another

MS Word Document Form - Check Value of Text Form Field on Exit

北城以北 提交于 2020-01-07 03:22:48
问题 I'm creating a Form in Microsoft Word. I have several 'Text form fields' some of which I want to restrict so users can only enter numbers. I don't understand why Microsoft gives you the option to change the 'Type' to 'Number' when that still allows any value to be input. Since that seems to be the case I have turned to VBA. I'm trying to run a macro when the user exits one of these fields, to make sure the input is valid. I would rather not create a new macro for each field I want to restrict

MS Word Document Form - Check Value of Text Form Field on Exit

蹲街弑〆低调 提交于 2020-01-07 03:22:10
问题 I'm creating a Form in Microsoft Word. I have several 'Text form fields' some of which I want to restrict so users can only enter numbers. I don't understand why Microsoft gives you the option to change the 'Type' to 'Number' when that still allows any value to be input. Since that seems to be the case I have turned to VBA. I'm trying to run a macro when the user exits one of these fields, to make sure the input is valid. I would rather not create a new macro for each field I want to restrict

Merge and Split Word Documents using Microsoft.Office.Interop.Word in C#

对着背影说爱祢 提交于 2020-01-07 02:55:05
问题 I need to merge many Word files into a single file, send it for a revisor and split it again to same separated files. There is about 200 small Word documents. So, when I'm doing the merge I need to add any type of mark for reference for when I will split it. I'm actually adding a tag with the original file name, the final Word file will be like this: [ c:\doc\file1.doc ] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget ipsum non est ultricies bibendum ac a sapien. Etiam

Add word document and keep formatting

ε祈祈猫儿з 提交于 2020-01-07 02:50:42
问题 I am attempting to add my CV to the end of a document. The following code does just that but the formatting of the CV is messed up once it is inserted into the new document. Can I insert the file and keep the original formatting of the CV (I dont want to copy and paste from an open document): objword1.Selection.InsertFile Filename:=cv1Address, _ ConfirmConversions:=False, Link:=False, Attachment:=False 回答1: I'm afraid that you can't use the InsertFile-method but have to open the file and copy

MS Word macro to correct partially formatted words

我是研究僧i 提交于 2020-01-07 02:21:39
问题 I made a macro that replaces all characters in a text, from old transcription fonts to a unicode font. I don't know why, but some characters keep the original formatting, while others lose the formatting (in my case, mostly italics), often within the same word. This leaves me with a lot of words in which some letters are italicized, and other letters aren't (e.g., " al-Malik al-Mu ǧā hid ḫu ṭ ba "). The characters that lose the formatting are all characters with diacritics, but not all

Fill in word form field with more than 255 characters

懵懂的女人 提交于 2020-01-07 01:12:13
问题 I am trying to programmaticly fill in a microsoft word form. I am successfully able to do so if the string is under 255 chars with the following code below, however it says the string is too long if i try and use a string over 255 chars... How do I get past this limitation? If I open the word doc in word I can type in more than 255 chars without a problem. Does anyone know how to input more characters via c# code? object fileName = strFileName; object readOnly = false; object isVisible = true