
Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
The user will be inserting these on specific pages. When I parse for the
field I then need to determine what page it is on. So there is no way to
use a DocVariable at time of insertion because the page an item is on may
change as content is added to the document.
Basically I am creating a page level dynamic tag which is used to insert
classification markers and related information used to tag content of a
paragraph. So a given page and multiple pages may contain multiple markers
that re the same or different. When the page is parsed I then generate a
page specific docvarible, which is in turn used to set a page specific
header/footer element.
> Use a DocVariable for the SEQ label and a DocVariable field to incorporate
> it in the SEQ field. For that matter, why not simply use document
[quoted text clipped - 27 lines]
>>>>
>>>> Any thoughts or insight on this approach?
Dave Lett - 08 Feb 2006 21:23 GMT
Hi,
So, you want to know the page number a field is on? Is that it? You can use
the .Information property for that without inserting a nested field. See the
following for an example:
For Each oFld In ActiveDocument.Fields
Debug.Print oFld.Result.Information(wdActiveEndPageNumber)
Next oFld
HTH,
Dave
> The user will be inserting these on specific pages. When I parse for the
> field I then need to determine what page it is on. So there is no way to
[quoted text clipped - 38 lines]
> >>>>
> >>>> Any thoughts or insight on this approach?
ML - 08 Feb 2006 23:40 GMT
Yes part of it is knowing what page it is on, the other part is putting it
on the page with the embedded info that I need to parse out.
> Hi,
>
[quoted text clipped - 63 lines]
>> >>>>
>> >>>> Any thoughts or insight on this approach?
Dave Lett - 09 Feb 2006 13:14 GMT
Hi,
You mentioned that you need to "need to determine what page it is on." I
offered a method that can do this.
What I'm failing to understand is why you must put the page number on the
page with the field. You're parsing the field. The page number doesn't have
to be part of that field if you only need to use/return that page number to
your routine.
Dave
> Yes part of it is knowing what page it is on, the other part is putting it
> on the page with the embedded info that I need to parse out.
[quoted text clipped - 66 lines]
> >> >>>>
> >> >>>> Any thoughts or insight on this approach?
ML - 09 Feb 2006 13:36 GMT
I don't need to put the page number on the page with field, I need to know
the page a field is on and also what the field contains.
The issue however is the fields are dynamically generated, as there are many
possibilities plus also user entered data.
The user will use a form that they select settings on or enter user text.
This in turn will place a field on the page at the cursor position. This is
used to flag/mark a paragraph with specific data to indicate the security
level applied to the page and shown in the header/footer.
To do this I need to parse for all the tags, figure out what page they are
on and then generate a page specific variable that the header/footer can use
to display the proper message.
> Hi,
>
[quoted text clipped - 92 lines]
>> >> >>>>
>> >> >>>> Any thoughts or insight on this approach?
Dave Lett - 09 Feb 2006 17:03 GMT
You need to parse all fields.
You need to know the page number that each field is on.
Therefore, you can use the .Information property, as shown in the following
example.
Dim oFld as Field
Dim lPgNum As Long
For Each oFld In ActiveDocument.Fields
'parse your field
lPgNum = oFld.Result.Information(wdActiveEndPageNumber)
'now you have the field parsed and
'and the page number of each field
'generate a page specific variable
Next oFld
Dave
> I don't need to put the page number on the page with field, I need to know
> the page a field is on and also what the field contains.
[quoted text clipped - 106 lines]
> >> >> >>>>
> >> >> >>>> Any thoughts or insight on this approach?
Peter Jamieson - 08 Feb 2006 23:07 GMT
First, if you want a hidden component, there are various fields that do not
display a result that you could adapt. The simplest is probably SET, e.g.
{ SET X info1 info2 info3 }
You could also try { ADDIN } or { PRIVATE }, assuming there is no reason to
believe they are being used for any other purpose.
Given the type of thing you're attempting you might find the last part of
http://gregmaxey.mvps.org/Conditional_Headers_Footers.htm
useful.
Peter Jamieson
> The user will be inserting these on specific pages. When I parse for the
> field I then need to determine what page it is on. So there is no way to
[quoted text clipped - 38 lines]
>>>>>
>>>>> Any thoughts or insight on this approach?
ML - 08 Feb 2006 23:42 GMT
Thanks.
Already have used conditional headers and footers. It was too simplistic
for our needs and thus why I am trying to extend the concept. We have too
many possibilities to code them all using the conditional method. As is
with conditional we ended up with about 10-12 combinations for 2 separate
fields but now we have even more, plus we also need to handle freeform text
values that a user may enter into our tags.
> First, if you want a hidden component, there are various fields that do
> not display a result that you could adapt. The simplest is probably SET,
[quoted text clipped - 55 lines]
>>>>>>
>>>>>> Any thoughts or insight on this approach?
Peter Jamieson - 09 Feb 2006 00:23 GMT
Understood - no further suggestions except that if you need to keep stuff
out of the way of the user you could store stuff in document variables and
limit your use of fields to storing references to those variables. Probably
lots of pain with no gain though.
Peter Jamieson
> Thanks.
>
[quoted text clipped - 64 lines]
>>>>>>>
>>>>>>> Any thoughts or insight on this approach?
ML - 09 Feb 2006 11:37 GMT
Yes, the biggest issue with variable is they are not page specific so only
way I found to make a page specific variable is to embed a field on a page.
Not the best approach but only one I could find.
If anyone has other ideas I'd love to hear them.
> Understood - no further suggestions except that if you need to keep stuff
> out of the way of the user you could store stuff in document variables and
[quoted text clipped - 72 lines]
>>>>>>>>
>>>>>>>> Any thoughts or insight on this approach?