$word_app->ActiveWindow->ActivePane->View->{Type} = wdPrintView; $word_app->ActiveWindow->ActivePane->View->{SeekView}= wdSeekCurrentPageHeader; $word_app->Selection->WholeStory; $word_app->Selection->Fields->Update; #### $sections=$doc->Sections->Count();