ms-word

How can an OpenOffice document be created in C++ [duplicate]

≡放荡痞女 提交于 2020-01-02 08:29:07
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Creating, opening and printing a word file from C++ Hi, I need to create a word document from a c++ program, Im using windows 2008 server,office automation fails sometimes here and also I need non interactive service to handle as automation provides interactive service.I've implemented automation it fails sometimes What are the ways I can create openoffice / word doc? can you please suggest me any links or

Send BACKSPACE keystroke in Word VBA

陌路散爱 提交于 2020-01-02 08:28:10
问题 I have made some code in Word VBA and at the end I need 1 backspace keytroke. How is this achievable? 回答1: The simple way to send a backspace (but not the most robust solution) : SendKeys ("{BACKSPACE}") A safer way to do this : Selection.MoveLeft Extend:=wdExtend Selection.Delete If something is already selected, and you want to delete just the last character, preface the above by : Selection.Collapse wdCollapseEnd To go to the start of the current page : ActiveDocument.GoTo(wdGoToPage,

What's the best approach to generate Word document based on existing templates

不打扰是莪最后的温柔 提交于 2020-01-02 08:27:33
问题 TL;DR Can I generate Word documents with .NET like XAML ItemTemplates? I'm finding it pretty hard to come up with a solution that meets all my requirements, so I thought I'll throw this out to stackoverflow in the hope someone can guide me. Much thanks in advance. Simply put, I need to generate Word document based on data from a database. My ideal solution: I want it to work like how DataTemplates work in xaml. I've found heaps of examples and solutions where the Template represents a static

What's the best approach to generate Word document based on existing templates

谁说我不能喝 提交于 2020-01-02 08:27:19
问题 TL;DR Can I generate Word documents with .NET like XAML ItemTemplates? I'm finding it pretty hard to come up with a solution that meets all my requirements, so I thought I'll throw this out to stackoverflow in the hope someone can guide me. Much thanks in advance. Simply put, I need to generate Word document based on data from a database. My ideal solution: I want it to work like how DataTemplates work in xaml. I've found heaps of examples and solutions where the Template represents a static

What are the benefits of MS Word content controls?

一个人想着一个人 提交于 2020-01-02 07:14:32
问题 Office 2007 brings a new goodie called as 'content controls'. I need to evaluate this to see if this serves as a solution for a problem under research. Due to paucity of time and my general disdain for Office-interop-pains, can someone summarize the benefits? Is it possible to define custom content controls? where do all the word programmers (if there are any) hang out :) ? RTFMsdn links also welcome. So far I see (from some screencasts) that its now possible to define - template word docs

How to prepare a Word 2007 document so that C# can pull data out of it semantically?

╄→尐↘猪︶ㄣ 提交于 2020-01-02 06:43:10
问题 I have a friend who is writing a 400-page book in Microsoft Word 2007. Throughout the book he has 200 stories each which consist of numerous paragraphs. When he is finished writing the book, he wants to copy the text of each story that is embedded in his Word document into a database table such as: Title, varchar(200) Description, text Content, text We do not want to have to copy and paste each story into the database but want to have a program automatically pull the marked up data from the

Mail Merge into word

你离开我真会死。 提交于 2020-01-02 05:34:48
问题 The Best way to create labels is using existing industry standard tools , such as Microsoft word. How do you execute this and set up the shipping labels ? I am unsure how to map merge fields against data grid view columns. This is the code I have so far: // Create a new empty document. DocumentModel document = new DocumentModel(); // Add document content. document.Sections.Add( new Section(document, new Paragraph(document, new Field(document, FieldType.MergeField, "FullName")))); // Save the

Filling Word template fields with C#

跟風遠走 提交于 2020-01-02 05:23:44
问题 Currently, if I create a Word Document Template with fields, and then fill them using C#, I do it similar to this... object missing = Type.Missing; Word.Application app = new Word.Application(); Word.Document doc = app.Documents.Open("file.doc", ref missing, true); Word.FormFields fields = doc.FormFields; fields[2].Result = "foo" fields[3].Result = "bar" Is there a better way to reference the fields? I notice when creating the template I can add a Title and a Tag to the field, but I haven't

Insert bold text into Word using VBA

早过忘川 提交于 2020-01-02 04:43:05
问题 I wrote a little script that exports certain Excel cell values into Word. However, certain inserts need to be bold. And there doesn't seem to be an easy way to do this. This code loops through the records and adds them to the Word document Do While intRow < intTotalRows + 1 strTemp = " ;b;" & Range("G" & intRow).FormulaR1C1 & " " & Range("I" & intRow).FormulaR1C1 & ";e; " If strTemp <> strCur Then strCur = strTemp .Content.Font.Bold = True .Content.InsertAfter strCur End If .Content.Font.Bold

Insert an image into a word document in Java

与世无争的帅哥 提交于 2020-01-02 03:11:54
问题 Can someone point me in the right direction on how to insert an image into a word document in Java? 回答1: Just an idea: At first you will need to download the WordAPI, which can be downloaded right here. To create word documents with JAVA, there's a class doing everything you need. The class is called WordProcessing. Here's a short preview of the methods implemented in that class: createNewDocumentFromTemplate(String templateName) createNewDocumentFromTemplateToSelectByUser()