Reply
 
Thread Tools Display Modes
  #1   Report Post  
Bill
 
Posts: n/a
Default Using variables in a document

I would like to know how to use variables
to make references to other parts of a
document.

For example:

blah blah blah.....(See page {blahpg} for
further discussion)

where blahpg is a variable set in the area of
the document corresponding to the referenced
page.

like: {set blahpg = &curpage} is coded amongst
the text to which the reference is being made.

So, I think the question really is what is the
pseudo variable name used to capture the
current page number, "&curpage".

Or, is my approach entirely wrong for what
I'm trying to accomplish.

Thanks,
Bill


  #2   Report Post  
Greg
 
Posts: n/a
Default

Bill,

You need to use a cross reference. Lots of ways to do it, but here is
one.

Go to whatever page blah, blah is described and select the text. Then
InsertBookmark. Lets name the bookmark "Blah"

Now go back to your text where you have See page. Put your cursor
after "page" then InsertCross Reference. Use Reference Type:
Bookmark
Insert Reference To: Page Number
Select Blah and click insert.

  #3   Report Post  
Bill
 
Posts: n/a
Default

Thanks Greg, I thought that maybe bookmarks was
the way it was done when I searched the HELP text,
but the HELP text is really weak when it comes to
examples of how they are used.

Okay, so that works until the document expands with
the addition of additional text/pages. When that happens,
the reference becomes invalid. I.e., the referenced page
does not get updated automatically as the document
expands.

Do I have to do something else?
Bill


"Greg" wrote in message
ups.com...
Bill,

You need to use a cross reference. Lots of ways to do it, but here is
one.

Go to whatever page blah, blah is described and select the text. Then
InsertBookmark. Lets name the bookmark "Blah"

Now go back to your text where you have See page. Put your cursor
after "page" then InsertCross Reference. Use Reference Type:
Bookmark
Insert Reference To: Page Number
Select Blah and click insert.



  #4   Report Post  
Bill
 
Posts: n/a
Default

I found Edit - Select All - PF9 that will update
all selected fields. Is that the answer to my last post?
Bill


"Bill" wrote in message
nk.net...
Thanks Greg, I thought that maybe bookmarks was
the way it was done when I searched the HELP text,
but the HELP text is really weak when it comes to
examples of how they are used.

Okay, so that works until the document expands with
the addition of additional text/pages. When that happens,
the reference becomes invalid. I.e., the referenced page
does not get updated automatically as the document
expands.

Do I have to do something else?
Bill


"Greg" wrote in message
ups.com...
Bill,

You need to use a cross reference. Lots of ways to do it, but here is
one.

Go to whatever page blah, blah is described and select the text. Then
InsertBookmark. Lets name the bookmark "Blah"

Now go back to your text where you have See page. Put your cursor
after "page" then InsertCross Reference. Use Reference Type:
Bookmark
Insert Reference To: Page Number
Select Blah and click insert.





  #5   Report Post  
Greg Maxey
 
Posts: n/a
Default

Bill,

Yes. Here is my boiler plate answer to updating fields.

When a change is made, you can update the field by selecting the field and
pressing F9, or update all fields by pressing CTRL+a (selects all) and
pressing F9, toggling to and from print preview (if "Update Fields" is
checked in the FilePrintOptions dialog box), or running a macro something
like:

Sub UpdateFields()
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
oStory.Fields.Update
If oStory.StoryType wdMainTextStory Then
While Not (oStory.NextStoryRange Is Nothing)
Set oStory = oStory.NextStoryRange
oStory.Fields.Update
Wend
End If
Next oStory
Set oStory = Nothing
End Sub



--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

Bill wrote:
I found Edit - Select All - PF9 that will update
all selected fields. Is that the answer to my last post?
Bill


"Bill" wrote in message
nk.net...
Thanks Greg, I thought that maybe bookmarks was
the way it was done when I searched the HELP text,
but the HELP text is really weak when it comes to
examples of how they are used.

Okay, so that works until the document expands with
the addition of additional text/pages. When that happens,
the reference becomes invalid. I.e., the referenced page
does not get updated automatically as the document
expands.

Do I have to do something else?
Bill


"Greg" wrote in message
ups.com...
Bill,

You need to use a cross reference. Lots of ways to do it, but here
is one.

Go to whatever page blah, blah is described and select the text. Then
InsertBookmark. Lets name the bookmark "Blah"

Now go back to your text where you have See page. Put your cursor
after "page" then InsertCross Reference. Use Reference Type:
Bookmark
Insert Reference To: Page Number
Select Blah and click insert.





  #6   Report Post  
Bill
 
Posts: n/a
Default

Got it Greg, thanks again.
Bill


"Greg Maxey" wrote in message
...
Bill,

Yes. Here is my boiler plate answer to updating fields.

When a change is made, you can update the field by selecting the field and
pressing F9, or update all fields by pressing CTRL+a (selects all) and
pressing F9, toggling to and from print preview (if "Update Fields" is
checked in the FilePrintOptions dialog box), or running a macro
something like:

Sub UpdateFields()
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
oStory.Fields.Update
If oStory.StoryType wdMainTextStory Then
While Not (oStory.NextStoryRange Is Nothing)
Set oStory = oStory.NextStoryRange
oStory.Fields.Update
Wend
End If
Next oStory
Set oStory = Nothing
End Sub



--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

Bill wrote:
I found Edit - Select All - PF9 that will update
all selected fields. Is that the answer to my last post?
Bill


"Bill" wrote in message
nk.net...
Thanks Greg, I thought that maybe bookmarks was
the way it was done when I searched the HELP text,
but the HELP text is really weak when it comes to
examples of how they are used.

Okay, so that works until the document expands with
the addition of additional text/pages. When that happens,
the reference becomes invalid. I.e., the referenced page
does not get updated automatically as the document
expands.

Do I have to do something else?
Bill


"Greg" wrote in message
ups.com...
Bill,

You need to use a cross reference. Lots of ways to do it, but here
is one.

Go to whatever page blah, blah is described and select the text. Then
InsertBookmark. Lets name the bookmark "Blah"

Now go back to your text where you have See page. Put your cursor
after "page" then InsertCross Reference. Use Reference Type:
Bookmark
Insert Reference To: Page Number
Select Blah and click insert.





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
Opening a document in a protected form CheeryNan Microsoft Word Help 5 August 1st 22 07:34 AM
Can you save individual document pages as seperate word files? John Calligy Mailmerge 2 April 12th 05 09:14 AM
Document out of focus Cor van der Bliek Microsoft Word Help 8 February 8th 05 09:29 AM
Newbie document question please Dudley Henriques New Users 4 January 9th 05 09:38 PM
Document object in protected form Bruce Tables 2 December 6th 04 08:09 PM


All times are GMT +1. The time now is 01:38 AM.

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"