Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2007

Tip: Looking for answers? Try searching our database.

'Seeing' text in fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed - 29 Oct 2007 19:35 GMT
I am trying to avoid search and other activity in fields (the kind that
are revealed/hidden when alt-F9 is pressed.) I want to be able to see the
fields, but not have Word (or my VBA commands) do anything. In particular, I
want to count the number of forward slashs in a particular paragraph. This
particular paragraph contains a field. The field contains slashs within its
content. Even when the field is toggled 'off' the field displays slashes
because the default answer which is calculated by the <<IF>> field contains
slashes. Therefore it is simply not possible to hide all slashes (or is
there?). Is there anyway to tell VBA to ignore all text within a field, or
to temporarily hide a field, while certain processes are being conducted?

--Ed in Virginia.
Ed - 29 Oct 2007 23:21 GMT
I have answered my own questions, but in case anyone is interested in the
solution, here it is.

   I wrote a small routine to quickly run through and select every field. I
then look in the selected field to see if it contains a slash. If it does, I
hide it. That way the slashes cannot be processed.

Sub HideSlashFields()
For Each ofield In ActiveDocument.Fields
   ofield.Select
   If InStr(Selection, "/") Then Selection.Font.Hidden = True
Next
End Sub

At the end of the routine, I unhide the hidden fields. Works like a charm.

Ed (in Virginia)

>    I am trying to avoid search and other activity in fields (the kind that
> are revealed/hidden when alt-F9 is pressed.) I want to be able to see the
[quoted text clipped - 9 lines]
>
> --Ed in Virginia.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.