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 / Tables / July 2006

Tip: Looking for answers? Try searching our database.

selection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joanne - 28 Jul 2006 14:30 GMT
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
Jezebel - 28 Jul 2006 16:02 GMT
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

>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
[quoted text clipped - 3 lines]
> Much thanks
> Joanne
Joanne - 28 Jul 2006 21:45 GMT
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

>Simpler is not to use the selection at all --
>
[quoted text clipped - 19 lines]
>> Much thanks
>> Joanne
 
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.