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 / January 2006

Tip: Looking for answers? Try searching our database.

Remove focus from header

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hals_left - 25 Jan 2006 11:51 GMT
Hi I have the following code that is run after prodcuing a dynamic
document.
After running this, the documment is left with the cursor in the header
. Is there a simple command I can add to just put the focus back into
the main document - anywhere will do!.

Thanks in advance.
hals_left

Sub addHeader(strText)
   ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
   Selection.ParagraphFormat.Alignment = wdAlignParagraphLeft
   Selection.TypeText Text:= strText & "         Page: "
   Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:= _
       "PAGE  \* Arabic ", PreserveFormatting:=True
   Selection.TypeText Text:=" of "
   Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:= _
       "NUMPAGES   \* Arabic ", PreserveFormatting:=True
End Sub
Graham Mayor - 25 Jan 2006 11:32 GMT
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Hi I have the following code that is run after prodcuing a dynamic
> document.
[quoted text clipped - 17 lines]
>        "NUMPAGES   \* Arabic ", PreserveFormatting:=True
> End Sub
 
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.