![]() |
|
#7
|
|||
|
|||
|
"(ActiveDocument.MailMerge.ViewMailMergeFieldC odes = wdToggle) which should merge the data into the document."
No, it shouldn't. Again, the ABC button does not perform a merge. It only previews. I don't know why that is giving you an error though, but it isn't supposed to merge. I am not clear... is it true that you have templates that contain merge fields and you want to create a macro that creates a new doc based on the dot and then completes the merge to a new doc? If so, I would expect your macro to resemble: Code:
Sub NewDocAndMerge()
'
' NewDocAndMerge Macro
' Macro recorded 6/14/2010 by kimberly
'
Documents.Add Template:= _
"C:\Documents and Settings\Administrator\Application Data\Microsoft\Templates\mergetest.dot" _
, NewTemplate:=False, DocumentType:=0
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=False
End With
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Default Custom Dictionary Based on Document
|
PatrickYork | Word | 3 | 04-03-2015 11:19 PM |
| Dock a custom floating toolbar? | itgoeson | PowerPoint | 0 | 05-25-2010 08:34 AM |
| Docs open under formatting toolbars | clive | Word | 0 | 01-22-2010 06:26 PM |
| command buttons | ronf | Excel | 0 | 04-28-2006 08:32 AM |
| command buttons | ronf | Excel | 0 | 12-03-2005 06:26 AM |