Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find multiple characters in one find using MSword find/replace | Microsoft Word Help | |||
How to insert the pilcrow in Word 2002 Find and Replace fields | Microsoft Word Help | |||
Trying to replace words with fields using Find/Replace | Microsoft Word Help | |||
Find and replace in subsequent text form fields? | Page Layout | |||
How do I find & replace "text form fields"? | Microsoft Word Help |