Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8986247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:30:19+00:00 2026-06-15T21:30:19+00:00

When selecting a Header Range using .Select() , Microsoft Word automatically switches to Draft

  • 0

When selecting a Header Range using .Select(), Microsoft Word automatically switches to Draft View from my current view type (Print layout). How do I stop Word from switching to Draft View?

The following code example demonstrates what I’m doing:

 // this.Document is a Microsoft.Office.Interop.Word.Document
 Section section = this.Document.Sections.First;
 foreach (HeaderFooter header in section.Headers)
 {
   if (header.Exists) 
   {
     header.Range.Select(); // When I call this, Word switches to Draft View.
     break;
   }
 }

Edit (3):

Apparently saving the View Type and resetting it does work. However, this causes a annoying flickering when Word switches to Draft View and then back to Print Layout. Additionally, when I double click in the main document space to get out of the header section, Word switches back to Draft View.

 WdViewType viewType = this.Document.ActiveWindow.View.Type;
 range.Select();
 this.Document.ActiveWindow.View.Type = viewType;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:30:20+00:00Added an answer on June 15, 2026 at 9:30 pm

    The View.SeekView property must be set for all view types excluding wdNormalView (Draft View) before the range is selected.

    var window = this.Document.ActiveWindow;
    // wdNormalView == Draft View, where SeekView can't be used and isn't needed.
    if (window.View.Type != WdViewType.wdNormalView)
    {
      // -1 Not Header/Footer, 0 Even page header, 1 Odd page header, 4 First page header
      // 2 Even page footer, 3 Odd page footer, 5 First page footer
      int rangeType = range.Information[WdInformation.wdHeaderFooterType];
      if (rangeType == 0 || rangeType == 1 || rangeType == 4)
        window.View.SeekView = WdSeekView.wdSeekCurrentPageHeader;
      if (rangeType == 2 || rangeType == 3 || rangeType == 5)
        window.View.SeekView = WdSeekView.wdSeekCurrentPageFooter;
    }
    header.Range.Select();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm selecting my data with the following statement: select distinct min(revision_number) as revno,po_number from
i am using asp.net gridview in header i have two columns column select all
I'm selecting my data with the following statement: select distinct min(revision_number) as revno,po_number from
I have users selecting a DateTime using a caldendar/clock popup that allows them to
I'm selecting products from a database table. Currently the query is launched from Coldfusion,
I have a table with links in the header that hide a range of
I have an ExtJs Grid with CheckBoxSelectionModel . Selecting the header checkbox checks all
I am using the datagrid from WPF toolkit in a WPF windows application. It
I'm looping through rows in a datagridview, and selecting a cell from the 3rd
I am having major trouble selecting the most current/matching row in my database. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.