Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-17-2025, 12:46 AM
macropod's Avatar
macropod macropod is offline Search for and replace merge fields in Word doc with plain text using VBA Windows 10 Search for and replace merge fields in Word doc with plain text using VBA Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
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

I can't see why merging shouldn't work for mergefields outputting dates or formatted numbers. At most, if the fields are remaining in the documents post-merge, your commented-out line of code:


oWordDoc.Fields.Unlink
is all that's needed (the equivalent of Ctrl-A, Ctrl-Shift-F9). Indeed, you can even do that without doing any merging. Either way, having converted all your fields to plain text, replacing the text results with your "simple codes within square brackets" should be a breeze.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
mailmerge, ms-word, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Search for and replace merge fields in Word doc with plain text using VBA Plain text help with returns - looking for marker to use when converting to plain text redzan Word 1 04-18-2017 06:17 PM
Macro to keep formatted form fields after mail merge or replace text with formatted form fields jer85 Word VBA 2 04-05-2015 10:00 PM
Searhc for Hyperlinked Word and replace with plain text or nothing somniloquist Word 3 10-04-2011 02:33 AM
Search for and replace merge fields in Word doc with plain text using VBA Replace all occurrences of one merge field with plain text blankenthorst Mail Merge 5 07-01-2011 05:18 AM
Replace All with plain text containing subscript DeaducK Word 0 06-24-2010 08:16 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:07 PM.


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