SharePoint 2007: Configure the Document Library Document Opening before the migratation to SP Online

Regular Contributor

When you are working on migration project from SP2007 (it's the end of it's life, but still exist in production), you have to fight with the file opening settings to support the Office Web Application solution.

SP 2007 is not basically supporting the Office Web Apps but there is a tip to know to support that after migration without change the settings manually in SPO for each doclib.


From the SharePoint 2007 site

You can change that settings with the SharePoint 2007 web page, via the option:

  • Document library Settings > Advanced Settings


You have to select the second option "Display as a Web Page” which will be supported in SPO after the migration:





From PowerShell

The other option to use is the following script which will do that change into all site/subsites for all the existing DocLib from a given SP2007:


function Check-DocumentLibraryOpenSettings([string]$SiteCollectionURL)
     [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null

     Write-Host " -------------------------------------------------------- "
     Write-Host "Site collection URL to configure:", $SiteCollectionURL  -foregroundcolor Red
     $Thesite = new-object Microsoft.SharePoint.SPSite($SiteCollectionURL)

    #Loop all Sub Sites
     foreach($Web in $TheSite.AllWebs)
         Write-Host "-----------------------------------------------------"
         Write-Host "Site Name: '$($web.Title)' at $($web.URL)"  -foregroundcolor green
         Write-Host "-----------------------------------------------------"
         foreach($list in $Web.Lists)
             #Filter Doc Libs, Eliminate Hidden ones
             if(($List.BaseType -eq "DocumentLibrary") -and ($List.Hidden -eq $false) )
                 Write-Host "List Name: '$($List.Title)'", "- Open Option before the change:", $List.DefaultItemOpen  -foregroundcolor Magenta

                 $List.DefaultItemOpen =  [Microsoft.SharePoint.DefaultItemOpen]::Browser; #Mode Web Application
                 #$List.DefaultItemOpen =  [Microsoft.SharePoint.DefaultItemOpen]::PreferClient; #Mode MS Office rich client
     Write-Host " -------------------------------------------------------- "

Check-DocumentLibraryOpenSettings “http://myWebApplication2007/sites/MySiteCollection”


When you do that change, you can use your Migration tool to push the doclibs in SPO


Fabrice Romelard [MVP]

Original post in french:
Other references used:
1 Reply

Another associated tip if you have document library with many files in Checked out mode:



You will find 2 functions you can adapt and use before the content migration.