Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2016, 07:37 PM
macropod's Avatar
macropod macropod is offline Applications Hanging During Merge Windows 7 64bit Applications Hanging During Merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you want a Directory merge, change:
.MainDocumentType = wdFormLetters
to:
.MainDocumentType = wdDirectory
Do note, however, that means you'll lose your individual page headers & footers - a Directory merge can have only one of each. An alternative would be to perform a Letter merge (as per the current code), then delete the Section breaks post-merge. The outcome will be the same, though. You can do that by inserting the following code after .DisplayAlerts = True
Code:
        With .ActiveDocument


If .Sections.Count > 1 Then For Each HdFt In .Sections(.Sections.Count).Headers If HdFt.Exists Then HdFt.Range.FormattedText = .Sections(1).Headers(HdFt.Index).Range.FormattedText HdFt.Range.Characters.Last.Delete End If Next For Each HdFt In .Sections(.Sections.Count).Footers If HdFt.Exists Then HdFt.Range.FormattedText = .Sections(1).Footers(HdFt.Index).Range.FormattedText HdFt.Range.Characters.Last.Delete End If Next End If Do While .Sections.Count > 1 .Sections(1).Range.Characters.Last.Delete DoEvents Loop .Range.Characters.Last.Delete End With
As for the AM/PM, I'm not having any trouble here. See attached.

The generation of duplicate reports suggests your code is being called twice.
Attached Files
File Type: docx DR15v1.docx (380.4 KB, 14 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing data between Office applications mdavies Office 1 11-26-2013 02:55 PM
Applications Hanging During Merge All Office Applications lock up when saving abreeden Office 1 05-18-2012 08:02 PM
Applications Hanging During Merge VB Applications? RiverStyx Office 1 05-30-2011 08:31 PM
Change skin color of applications? Jack R Office 0 07-04-2010 04:25 AM
How many Word applications are running GetObject stevecarr Word 0 01-09-2006 07:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft