保存邮件合并中的单个字母 [英] Save individual letters from mail merge
问题描述
我不是Word的新手,也不是专家。我已经阅读了有关添加宏或加载项的讨论,以便我可以保存邮件合并中的单个字母。我之前没有添加过一个宏,所以我想知道该方法的步骤,我也想知道加载项是什么,所以我可以要求我的公司购买它。这是讨论的宏观:
I am not new to Word but not an expert either. I have read discussions about adding a macro or an add-in so that I may save individual letters from a mail merge. I haven't added a macro before so would like to know the how-to steps for that and I would also like to know what the add-in is so I can ask my company to purchase it. This is the macro that the discussion had:
Sub SplitMergeLetter()
'splitter宏被修改为保存单个字母 来自数据源的
'信息。必须将文件名数据添加到合并字母顶部的
' - 请参阅网页文章。
Sub SplitMergeLetter()
' splitter Macro modified to save individual letters with
' information from data source. The filename data must be added to
' the top of the merge letter - see web article.
Selection.EndKey Unit: = wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:= wdStory
Counter = 1
而Counter<信件
&NBSP; Application.ScreenUpdating = False
&NBSP;选择
&NBSP; &NBSP;&NBSP; .HomeKey单位:= wdStory
&NBSP; &NBSP;&NBSP; .EndKey单位:= wdLine,延期:= wdExtend
&NBSP; &NBSP;&NBSP; .MoveLeft单位:= wdCharacter,计数:= 1,延长:= wdExtend
&NBSP;结束用
&NBSP; fldrname =选择
&NBSP; Docname =" C:\Clean DataBase \ WdQuotes \" &安培; fldrname& " \" &安培; "Guarantee.Doc"
&NBSP; ActiveDocument.Sections.First.Range.Cut
&NBSP; Documents.Add
&NBSP;选择
&NBSP; &NBSP; &NBSP; .Paste
&NBSP; &NBSP; &NBSP; .HomeKey单位:= wdStory
&NBSP; &NBSP; &NBSP; .MoveDown单位:= wdLine,计数:= 1,延期:= wdExtend
&NBSP; &NBSP; &NBSP; 。删除&bbsp; b $ b &NBSP;结束用
&NBSP;使用ActiveDocument $
&NBSP; &NBSP; &NBSP; .Sections(2).PageSetup.SectionStart = wdSectionContinuous
&NBSP; &NBSP; &NBSP; .SaveAs FileName:= Docname,_
&NBSP; &NBSP; &NBSP; FileFormat:= wdFormatDocument
&NBSP;结束用
&NBSP; ActiveWindow.Close
&NBSP; Counter = Counter + 1
&NBSP; Application.ScreenUpdating = True
Wend
Selection.EndKey Unit:=wdStory
Letters = Selection.Information(wdActiveEndSectionNumber)
Selection.HomeKey Unit:=wdStory
Counter = 1
While Counter < Letters
Application.ScreenUpdating = False
With Selection
.HomeKey Unit:=wdStory
.EndKey Unit:=wdLine, Extend:=wdExtend
.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
End With
fldrname = Selection
Docname = "C:\Clean DataBase\WdQuotes\" & fldrname & "\" & "Guarantee.Doc"
ActiveDocument.Sections.First.Range.Cut
Documents.Add
With Selection
.Paste
.HomeKey Unit:=wdStory
.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
.Delete
End With
With ActiveDocument
.Sections(2).PageSetup.SectionStart = wdSectionContinuous
.SaveAs FileName:=Docname, _
FileFormat:=wdFormatDocument
End With
ActiveWindow.Close
Counter = Counter + 1
Application.ScreenUpdating = True
Wend
End Sub
End Sub
推荐答案
使用互联网上的宏看
For using a macro you get on the Internet see
https://wordmvp.com/FAQs/MacrosVBA/CreateAMacro.htm
这解释了如何使用VBA编辑器并插入代码。
That explains how to use the VBA Editor and insert the code.
关于加载项我担心除非您提供讨论链接,否则我们无法帮助您。有许多加载项......
About the add-in I'm afraid we can't help you unless you provide a link to the discussion. There are many add-ins around...
这篇关于保存邮件合并中的单个字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!