word-2007

How do you change the content of a content control in Word 2007 with OpenXml SDK 2.0?

天大地大妈咪最大 提交于 2020-01-22 10:00:34
问题 About to go mad with this problem. I'm sure it's so simple I'm just missing it, but I cannot for the life of me find out how to change the content of a content control in Word 2007 with the OpenXml SDK v2.0 in C#. I have created a Word document with a plain text content control. The tag for this control is "FirstName". In code, I'd like to open up the Word document, find this content control, and change the content without losing the formatting. The solution I finally got to work involved

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 can I use Microsoft Word's spelling/grammar checker programmatically?

删除回忆录丶 提交于 2020-01-01 03:21:05
问题 I want to process a medium to large number of text snippets using a spelling/grammar checker to get a rough approximation and ranking of their "quality." Speed is not really of concern either, so I think the easiest way is to write a script that passes off the snippets to Microsoft Word (2007) and runs its spelling and grammar checker on them. Is there a way to do this from a script (specifically, Python)? What is a good resource for learning about controlling Word programmatically? If not, I

Insert HTML into OpenXML Word Document (.Net)

风流意气都作罢 提交于 2019-12-31 22:39:10
问题 Using OpenXML SDK, I want to insert basic HTML snippets into a Word document. How would you do this: Manipulating XML directly ? Using an XSLT ? using AltChunk ? Moreover, C# or VB examples are more than welcome :) 回答1: Here is another (relatively new) alternative http://notesforhtml2openxml.codeplex.com/ 回答2: Well, hard to give general advice, because it depends strongly on your input what is best. Here's a simple example inserting a paragraph into a DOCX document for each paragraph in an (X

COM Add-in not going away in word 2007

倖福魔咒の 提交于 2019-12-25 03:54:18
问题 So ive got two different COM addins, one for word 2k3 and one for 2k7. word 2k3 works like a charm everytime, no issues etc...but now when I open word 2k7, the buttons from 2k3 appear in my 2k7 ribbon. This still happens even after I disable my addin or clean my project...i've tried everything, including deleting all dlls for my 2k3 addin but the problem still persists... any suggestions on what the problem is? cheers 回答1: If you make a point of configuring those buttons in a template OTHER

COM Add-in not going away in word 2007

一个人想着一个人 提交于 2019-12-25 03:54:12
问题 So ive got two different COM addins, one for word 2k3 and one for 2k7. word 2k3 works like a charm everytime, no issues etc...but now when I open word 2k7, the buttons from 2k3 appear in my 2k7 ribbon. This still happens even after I disable my addin or clean my project...i've tried everything, including deleting all dlls for my 2k3 addin but the problem still persists... any suggestions on what the problem is? cheers 回答1: If you make a point of configuring those buttons in a template OTHER

Update embedded excel file programmatically

狂风中的少年 提交于 2019-12-20 01:07:23
问题 I'm trying to modify an embedded excel table in a word document programmatically. To do this, I have modified the docx file and the embedded excel file. The significant part of the main document is the following: <w:object w:dxaOrig="8406" w:dyaOrig="2056"> <v:shape id="_x0000_i1028" type="#_x0000_t75" style="width:390.75pt;height:95.25pt" o:ole=""><v:imagedata r:id="rId14" o:title=""/> </v:shape> <o:OLEObject Type="Embed" ProgID="Excel.Sheet.12" ShapeID="_x0000_i1028" DrawAspect="Content"

How can I create a header in a table for each new page with Word interop?

落爺英雄遲暮 提交于 2019-12-19 09:23:31
问题 I am trying to create a table with a header. I want this header to be repeated for each new page that the table takes. How can I do this in C# with Word 2007 Interop? 回答1: Microsoft.Office.Interop.Word.Table table; /* ... */ table.Rows[1].HeadingFormat = -1; 回答2: This is what word for me, Looping through each table at the end foreach (Table item in doc.Tables) { item.Rows[1].HeadingFormat = -1; item.ApplyStyleHeadingRows = true; } and setting a style on each table with the property set to

How to set printer properties using vb.net

只愿长相守 提交于 2019-12-13 08:47:51
问题 I am using EDRAW to browse a Microsoft Word and can be Print , Preview , ETC.. . And I am planning to add some features to it. I am adding 2 buttons for Print Short (8.5 by 11 inches) and Print Long (8.5 by 13 inches) and I have 2 printers for long and short. How to set the properties of the printers in each button?. If I click button short it will print short using printer 1 same as the button long but it is in printer 2. I am following the code in the Link provided above. Anyone has an idea

more than one Select All Checkboxes for each frame

我与影子孤独终老i 提交于 2019-12-13 07:22:23
问题 Following Userform has 4 (Four) Select All Check-boxes . SelectAllE for Eastern Europe SelectAllA for Middle East & Africa SelectAllL for Latin America & Caribbean SA for Select All Regions (Working) only the fourth one is working correctly Following are codes for each Checkboxes Private Sub SA_Click() ' this one is working Correctly Dim ctl As Control Dim j As Long For Each ctl In Me.Controls If TypeOf ctl Is MSForms.CheckBox Then If Me.Controls(ctl.Name).Value = True Then Me.Bulgaria.Value