问题标签 [mergefield]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
796 浏览

ms-word - 使用合并域从文本文件中导入数据 (MS Word 2010)

我在 MS Word 2010 中使用邮件合并。数据来自 Excel 电子表格:

假设我们有以下合并字段:"LASTNAME""FIRSTNAME""GROUP"

在我的文档中,我想添加一个特定于该组的段落。Word 会在名为“GROUP” .txt 的文件中查找此段落:

这是其中一个想法。这些段落也可以来自另一个来源,例如 Excel 工作表或 CSV 文件。

你知道我该怎么做吗?

0 投票
1 回答
169 浏览

rtf - 使用带有合并字段的 RTF 模板作为生成报告的输入

我需要从 j2EE/java 生成 word 文档,其中输入将是具有合并字段的 RTF 模板(.rtf 文档)。

我查看了只接受 docx 作为输入的 docx4j。需要模板引擎的 RTFTTemplate(不确定 - 文档不是很清楚)

任何人都可以帮助提供可用的选项。既开放又付费。

提前致谢!

0 投票
0 回答
46 浏览

c# - 使用相同的文本编辑多个合并字段

我正在使用 MSDN 示例代码用一些文本替换合并字段。但是,如果我有多个具有相同文本的合并字段,则代码只会影响一个而不影响其他。我该如何解决这个问题?

这是我正在使用的代码

我有 3 个简单字段,但它只替换了一个。

0 投票
1 回答
639 浏览

c# - .NET 和 Word - 如何将纯文本转换为文档中的 MergeField

我正在使用 Visual Studio .NET (VB) 所以如果你有 C# 的解决方案,请先到这里 ( http://converter.telerik.com/ )

我有一个带有文本的文档,以及要替换的单词数组:我需要替换纯文本并替换为实际的合并字段

0 投票
1 回答
1095 浏览

vba - 如何使用包含合并字段的公式创建合并字段

我想构建在来自两个不同合并字段的数据之间做出决定的合并字段。例如«field_1»应包含:

我尝试了以下方式:

也可以使用 insertFormula:

但这只是一团糟。

0 投票
1 回答
540 浏览

vba - Word VBA中的嵌套IF字段

我正在尝试从可能的合并字段列表中创建一个添加复杂 IF 语句创建的单词插件。

复杂的是

{ IF { = OR ( { COMPARE { MERGEFIELD Field_1 } <= "Value" }, { COMPARE { MERGEFIELD Field_2 } >= "Value" } ) } = 1 "True Instructions" "False Instructions" }

我试图在 VBA 中完成这一切,但如果我的 Complex 出现问题,因为我无法让“}”在正确的位置结束。

如果我在除末尾之外的任何其他位置使用终结符“Selection.EndKey Unit:=wdLine”,它会造成混乱并将所有 } 放在该行。

这是我的代码:

这就是我在生成“复杂如果”时得到的

但应该是这样的:

如果有人能对这件事有所了解,那我哪里错了。或者如果有一种方法可以强制结束 } 的位置,那就太好了我对 VBA 很陌生(我是 C++ 程序员)

0 投票
1 回答
93 浏览

word-2013 - Microsoft Word 合并字段标记波兰货币格式

我想将数字从 格式化1,234.251 234,25。我尝试了以下合并字段格式,但没有给出预期的结果{MergeField token \# "# ###,##"}。我整天都在谷歌上搜索,但没有运气。

0 投票
1 回答
485 浏览

ms-word - MERGEFIELD 的 MS Word MAILMERGE 自动编号

我刚刚学习了如何在 MS Word 中使用 MAILMERGE。我想列出我的 MERGEFIELD 使用字母顺序,我的代码是这样的:

上面代码的结果是:

当一个或多个 MERGEFIELD 值为空时,我遇到问题。例如,如果 { MERGEFIELD item3 } 为空,它将产生如下列表:

我想要的是这样的:

0 投票
2 回答
1241 浏览

excel - Mail Merging Photo ID's in Word 2010/2013

I've been spending a number of days on this issue, and I would appreciate if someone can help.

I've got an Excel sheet of data fields, with a field containing the paths of photos that I would like to create an ID card Mail Merge onto Avery Labels.

I've been able to merge all the data I need using Word 2010 and 2013 with no issues, but the problems occur when attempting to include the photos.

The images themselves can merge just fine if brought alone, showing different images in different labels as desired.

However, it's when I try to position the image in a square layout -so that the data fields appear alongside the image on a label -as opposed to under it- that the process breaks down.

What happens is, only the first image gets pulled through, and it gets copied over to all the other labels (even when showing their different ID's in the labels, it's always the first image that gets copied throughout). I have tried saving the document and then pressing F9, tried saving it to XML as some have suggested then refreshing but no luck, it stays with only the first image being copied throughout.

In the document itself I use { INCLUDEPICTURE "{MERGEFIELD Photos}" } with Photos being the name of the field in Excel containing the path. I have used different variations of this command, I've put the paths in the Excel sheet in between double quotes yet still the problem remains.

As soon as I try to change the layout of the photos so that the fields are displayed to the right of it, only the first image in the list comes through.

Has anyone encountered this or can help?

0 投票
2 回答
1598 浏览

ms-word - 合并字段水印 - Microsoft Word 2013

我想使用合并字段在 Word 文档中添加条件水印。有没有办法做到这一点?有没有办法使用如下合并字段条件来添加“草稿”水印?或任何其他方式使用条件使水印在文档上可见?我正在使用 Microsoft Word 2013。提前感谢您的帮助。