Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-22-2018, 08:14 PM
macropod's Avatar
macropod macropod is offline Find and replace a text with a field Windows 7 64bit Find and replace a text with a field 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

It's a waste of time trying to replace the displayed content of a field as it will revert to its previous value immediately anything causes the field to refresh; you need to change the contents of the variable itself. That can be done with code like:
ActiveDocument.Variables("MyVar").Value = "some name"
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and replace a text with a field Find & Replace text in Field Code across multiple documents RPM7 Word VBA 6 05-12-2017 12:58 AM
Find and replace a text with a field Macro to find text and replace with form field containing that text iiiiifffff Word VBA 16 06-04-2016 01:47 AM
Macro to find coloured text and replace with form-field/formtext containing that text tarktran Word VBA 1 11-26-2014 08:12 AM
search and replace a field containing text and numbers H28Sailor Word 6 09-11-2014 01:00 AM
Find and replace a text with a field Find and replace a string of text errtu Word 1 01-31-2013 02:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:43 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