Word 2007 ProofErr问题 [英] Word 2007 ProofErr Issue
问题描述
以下是我要做的事情:
- 我正在尝试修改Word 2007文件的文档XML。
< p align = left> - 我使用C#
将XML读入字符串 - 我想对字符串执行替换,交换自定义标识符字(如#Amount# )在doc中,使用SQL中的数据。 (因此#Amount#将替换为1234.56,伪邮件合并)
- 我的替换失败,因为我的自定义单词被Word 2007分解。将w:proofErr标签添加到我的XML中,有时在我的自定义单词中间。
示例:
我的Word文档中有#Amount#。当我的代码试图找到#Anount#时,它会找到如下内容:
<
w:proofErr w:type = " spellStart " />
<
w:r ><
w:t > # < / w:t >< /
w:r >< w:proofErr w:type = " spellEnd " /><
w:r ><
w:t > 金额 < / w: t >< /
w :r >
有没有办法让Word避免这样做?谢谢!
(另外,输入":" then" p" make a笑脸,所以我在XML中放了一个空格)
是的,这是可能的。它添加了"金额"一词到词典
---------------------------------- -------------------------------------------------- -------------------------------------------------- -----------------------------------
Hola,
Sí,se puede。 Añadelapalabra"Amount" al diccionario de Word。
Here is what I am trying to do:
- I am attempting to modify the document XML of a Word 2007 file.
- I read the XML into a String using C#
- I want to do a Replace on the string, swapping out custom identifier words (like #Amount#) in the doc, with data from SQL. (So that #Amount# will be replaced with 1234.56, a pseudo mail-merge)
- My Replace is failing because my custom words are being broken up by Word 2007. It is adding w: proofErr tags into my XML, sometimes in the middle of my custom words.
Example:
I have #Amount# in my Word doc. When my code tries to find #Amount#, it instead finds something like:
<
w: proofErr w:type="spellStart"/><
w:r><
w:t>#</w:t></
w:r><w: proofErr w:type="spellEnd"/><
w:r><
w:t>Amount</w:t></
w:r>
Is there any way to have Word avoid doing this? Thanks!
(Also, typing ":" then "p" makes a smiley, so I put a space between them in the XML)
Hi,
Yes, it is possible. It adds the word "Amount" to the dictionary of Word
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hola,
Sí, se puede. Añade la palabra "Amount" al diccionario de Word.
这篇关于Word 2007 ProofErr问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!