ms-word

MS Word - excel cell, “update link” changes format. How to preserve format?

老子叫甜甜 提交于 2020-01-05 14:05:01
问题 I have a MS word paragraph with a few text strings linked to excel cells. When I "update link", the cell loses its formatting, with paragraphs added before and after that cell. Checking the "Preserve formatting after update" option in Word does not seem to work. "Keep source formatting" and "Merge formatting" pasting options give me the same result with this. I checked the source code in Word with alt+f9, and searched for something to add to it { LINK Excel.Sheet.12 "Book1" "Sheet1!R1C1" \a

How to export or create MATHML from MS word 2010?

浪尽此生 提交于 2020-01-05 12:26:46
问题 I have mathematical expressions in word document. Is it possible to export data as MATHML format? For example below formula existed in a word as a mathematical expression. Above expression should represent as below MATHML code. <math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> <mrow> <mi>x</mi> <mo>=</mo> <mfrac> <mrow> <mo>−</mo> <mi>b</mi> <mo>±</mo> <msqrt> <mrow> <msup> <mi>b</mi> <mn>2</mn> </msup> <mo>−</mo> <mn>4</mn> <mi>a</mi> <mi>c</mi> </mrow> </msqrt> </mrow> <mrow

How to export or create MATHML from MS word 2010?

拟墨画扇 提交于 2020-01-05 12:24:08
问题 I have mathematical expressions in word document. Is it possible to export data as MATHML format? For example below formula existed in a word as a mathematical expression. Above expression should represent as below MATHML code. <math xmlns="http://www.w3.org/1998/Math/MathML" display="block"> <mrow> <mi>x</mi> <mo>=</mo> <mfrac> <mrow> <mo>−</mo> <mi>b</mi> <mo>±</mo> <msqrt> <mrow> <msup> <mi>b</mi> <mn>2</mn> </msup> <mo>−</mo> <mn>4</mn> <mi>a</mi> <mi>c</mi> </mrow> </msqrt> </mrow> <mrow

Copy Text from Table in Word and Retaing Formatting

流过昼夜 提交于 2020-01-05 11:58:24
问题 I have a problem copying a cell from a table to another cell. I'm talking about two word documents here. I can copy the text but the bullets are gone and some of the formatting. I tried .Formattedtext but still can't do it. Dim test As Word.Cell 'An error occurs something like "Object variable or With block variable not set" test.Range.FormattedText = CTPDoc.Tables(2).Rows(testCount).Cells(3).Range.FormattedText 回答1: Here is an example. Let's say we have two tables in a word document. See

Remove MS Word macro using VBScript

筅森魡賤 提交于 2020-01-05 09:07:30
问题 I want to remove all vba-modules from an MS Word template using VBScript. I wrote the following script. const wdDoNotSaveChanges = 0 WScript.Echo "starting Word..." Dim oApplication, doc Set oApplication = CreateObject("Word.Application") WScript.Echo "opening template..." oApplication.Documents.Open "path\to\test.dot" Set doc = oApplication.ActiveDocument Dim comp, components Set components = oApplication.ActiveDocument.VBProject.VBComponents For Each comp In components components.Remove

MS-Word VBA, Regex, replace format only of first capturing group

别说谁变了你拦得住时间么 提交于 2020-01-05 08:07:17
问题 I try to record a replacement in VBA using Search & Replace with wildcards: I have strings comprised of 3 white spaces followed by the word normal, like " normal", and want to replace the 3 leading spaces with "1 " (a 1 followed by two spaces) the "1" in a blue font. giving: "1 normal" with the 1 in blue and "normal" in the original format.. I tried to match: ([^s]{3})normal but when replacing with a new format I always get the whole string re-formatted.. how to preserve the original format

OpenXML SDK getting ActiveX controls value

我与影子孤独终老i 提交于 2020-01-05 07:14:38
问题 For one of my projects in college I had to create a test as a Word document and add some ActiveX forms in it to be completed by another person. After this I had to programmatically extract the answers from it and put a grade on the test. I used OpenXML SDK for processing the document, but it gave me headaches because I couldn't find a way to get the ActiveX values. So what was the solution? 回答1: After searching the Internet and a bit of sniffing on the document I have found that the ActiveX

Why does my Modal WPF dialog slip behind MS Word

放肆的年华 提交于 2020-01-05 07:04:50
问题 I have a MS Word Application Add-in written with VSTO. It contains a button used to create new Letter documents. When pressed a document is instantiated, a WPF dialog is displayed to capture information and then the information is inserted into the document. On rare occasions, the WPF dialog slips behind MS Word. I then have to kill the Winword.exe process because the dialog is Modal. I use the following code for my WPF dialog. The OfficeDialog sub class is used to make the dialog look like a

Why does my Modal WPF dialog slip behind MS Word

霸气de小男生 提交于 2020-01-05 07:04:08
问题 I have a MS Word Application Add-in written with VSTO. It contains a button used to create new Letter documents. When pressed a document is instantiated, a WPF dialog is displayed to capture information and then the information is inserted into the document. On rare occasions, the WPF dialog slips behind MS Word. I then have to kill the Winword.exe process because the dialog is Modal. I use the following code for my WPF dialog. The OfficeDialog sub class is used to make the dialog look like a

Why doesn't SaveAs use correct PixelsPerInch in macro?

旧巷老猫 提交于 2020-01-05 06:43:05
问题 I have a macro which converts Word docs to htm. The problem is that the images are always saved as 96 ppi, even though I have specified 240 ppi. Any ideas on how to fix? Here is my macro: Sub Doc2htm() With ActiveDocument.WebOptions .RelyOnCSS = True .OptimizeForBrowser = False .OrganizeInFolder = True .UseLongFileNames = True .RelyOnVML = False .AllowPNG = True .ScreenSize = msoScreenSize800x600 .PixelsPerInch = 240 .Encoding = msoEncodingWestern End With With Application.DefaultWebOptions