#1   Report Post  
Posted to microsoft.public.word.tables
Joanne Joanne is offline
external usenet poster
 
Posts: 10
Default selection

I am using a macro to select all, then alt+9 to update fields in my
doc. It works just fine, but when finished, the doc is still
completely selected.
Could someone please tell me what command to use in my macro to get
rid of the selection highlighting before exiting the macro.
Much thanks
Joanne
  #2   Report Post  
Posted to microsoft.public.word.tables
Jezebel Jezebel is offline
external usenet poster
 
Posts: 1,384
Default selection

Simpler is not to use the selection at all --

ActiveDocument.Fields.Update

will have the same effect. Either way, you're not updating fields in any
storyrange except the main body (ie not in headers or footers, textboxes,
footnotes, etc). If you need to update fields everywhere --

Dim pRange as Word.Range
For each pRange in ActiveDocument.StoryRanges
Do
pRange.Fields.Update
set pRange = pRange.NextStoryRange
Loop until pRange is nothing
Next





"Joanne" wrote in message
...
I am using a macro to select all, then alt+9 to update fields in my
doc. It works just fine, but when finished, the doc is still
completely selected.
Could someone please tell me what command to use in my macro to get
rid of the selection highlighting before exiting the macro.
Much thanks
Joanne



  #3   Report Post  
Posted to microsoft.public.word.tables
Joanne Joanne is offline
external usenet poster
 
Posts: 10
Default selection

Thanks Jezebel - solved the problem perfectly.

I do have one more question please.

On the lost focus event of this embedded spreadsheet, can I call the
update macro from the main word doc? I'm not even sure that lost focus
is allowed in Excel VBA or if there is some other command available
for when I exit the spreadsheet and return to the word doc. Can you
point me in the right direction please.
Thanks muchly
Joanne
Jezebel wrote:

Simpler is not to use the selection at all --

ActiveDocument.Fields.Update

will have the same effect. Either way, you're not updating fields in any
storyrange except the main body (ie not in headers or footers, textboxes,
footnotes, etc). If you need to update fields everywhere --

Dim pRange as Word.Range
For each pRange in ActiveDocument.StoryRanges
Do
pRange.Fields.Update
set pRange = pRange.NextStoryRange
Loop until pRange is nothing
Next





"Joanne" wrote in message
...
I am using a macro to select all, then alt+9 to update fields in my
doc. It works just fine, but when finished, the doc is still
completely selected.
Could someone please tell me what command to use in my macro to get
rid of the selection highlighting before exiting the macro.
Much thanks
Joanne




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
Hide a row in a table based upon a previous selection [email protected] Tables 6 June 7th 06 02:46 PM
Word 2003 Selection or Range Objects Lako Microsoft Word Help 2 March 8th 06 10:31 PM
Drop Down Selection on Save Big Rob Microsoft Word Help 3 December 15th 05 03:44 PM
Problem with Advanced selection Criteria JR Hester Mailmerge 2 November 3rd 05 07:24 PM
When I print a word doc 'print selection' does not appear as an op dawn Microsoft Word Help 1 November 1st 05 08:53 PM


All times are GMT +1. The time now is 02:06 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"