Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Mich Mich is offline
external usenet poster
 
Posts: 4
Default How do I Find and replace date fields?

Hi,
I have a doc in which date fields were used to indicate when the item /text
was added to the document. I want to find all the date fields and delete
them, without deleting the fields for figures/table and table of contents,
etc... I know I can use Find to find all the fields but I just want to find
and replace / delete the Date Fields.
Thanks,
MK
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 264
Default How do I Find and replace date fields?

Provided the fields are in the main text story then this should do:

Sub ScratchMacro2()
Dim oFld As Word.Field
For Each oFld In ActiveDocument.Range.Fields
Select Case oFld.Type
Case Is = wdFieldDate, wdFieldCreateDate, wdFieldSaveDate,
wdFieldPrintDate
oFld.Delete
Case Else
'Do Nothing
End Select
Next oFld
End Sub

If you need to iterate through all storyranges (e.g., headers,
footers, etc) then adapt the code shown he

http://gregmaxey.mvps.org/Field_Macros.htm




On Apr 27, 2:02 pm, mich wrote:
Hi,
I have a doc in which date fields were used to indicate when the item /text
was added to the document. I want to find all the date fields and delete
them, without deleting the fields for figures/table and table of contents,
etc... I know I can use Find to find all the fields but I just want to find
and replace / delete the Date Fields.
Thanks,
MK



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 264
Default How do I Find and replace date fields?

Of course you could just use:

^ d Date

in the find what and replace with nothing

repeat with the other date field types.

On Apr 27, 2:02 pm, mich wrote:
Hi,
I have a doc in which date fields were used to indicate when the item /text
was added to the document. I want to find all the date fields and delete
them, without deleting the fields for figures/table and table of contents,
etc... I know I can use Find to find all the fields but I just want to find
and replace / delete the Date Fields.
Thanks,
MK



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Mich Mich is offline
external usenet poster
 
Posts: 4
Default How do I Find and replace date fields?

Thanks Greg,
One minor point to Find Date Fields they need to be visible "Show Fields"
Alt+F9 will show all field codes then the find and replace works great.

Thanks again.

"Greg Maxey" wrote:

Of course you could just use:

^ d Date

in the find what and replace with nothing

repeat with the other date field types.

On Apr 27, 2:02 pm, mich wrote:
Hi,
I have a doc in which date fields were used to indicate when the item /text
was added to the document. I want to find all the date fields and delete
them, without deleting the fields for figures/table and table of contents,
etc... I know I can use Find to find all the fields but I just want to find
and replace / delete the Date Fields.
Thanks,
MK




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Find multiple characters in one find using MSword find/replace Cliff Microsoft Word Help 2 October 29th 06 07:48 PM
How to insert the pilcrow in Word 2002 Find and Replace fields A.N. Microsoft Word Help 2 July 2nd 06 10:37 PM
Trying to replace words with fields using Find/Replace mbleyle Microsoft Word Help 2 March 29th 06 11:35 PM
Find and replace in subsequent text form fields? Amanda Boswell Page Layout 1 November 22nd 05 11:00 PM
How do I find & replace "text form fields"? OneClothEar Microsoft Word Help 1 April 13th 05 10:15 PM


All times are GMT +1. The time now is 08:03 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"