SharePoint Adoption Kit – Show Me How Videos

Here is the collection of Show Me How videos from Microsoft for SharePoint 2010. These videos are part of the Microsoft SharePoint Adoption Kit and include some great examples. My favorites are video 1 Рphonetic search, video 2 Рco-authoring Word documents, video 6 Рthe Group Work Site and video 9 Рworkflow and document approval.

Sharepoint Adoption Kit Continue reading “SharePoint Adoption Kit – Show Me How Videos”

SP 2010: Create New Web Application and Site Collection

Create New Web Application

IIS Web Site

  1. Description: MOSS Web App – 80 (Consider TurtlePoint Web App – 80)
  2. Port: 80

Application Pool

  1. App Pool Name: MOSS Web App – 80 (Consider TurtlePoint Web App – 80)
  2. Account: spAppPool

Database Name and Authentication

  1. DB Name: MOSS_WebApp_Content

MOSS_WebApp_Content DB created
MOSS Web App Web – 80 Site created
MOSS Web App – 80 App Pool created

Create New Site Collection

Title and Description

  1. Title: Turtle Point

Template Selection

  1. Collaboration > Blank Site
  2. Activate these Site Collection Features
    1. SharePoint Server Enterprise Site Collection
    2. SharePoint Server Publishing Infrastructure
    3. SharePoint Server Standard Site Collection
    4. Publishing Approval Workflow if desired
  3. Activate these Site Features
    1. SharePoint Server Enterprise Site
    2. SharePoint Server Publishing
    3. SharePoint Server Standard Site
    4. Team Collaboration Lists

Primary Site Collection Administrator

  1. TURTLELLCAdministrator

No new database, web site or app pool created

Building a Search Center

To build a Search Center create a new site, selecting Enterprise > Search Center with Tabs.

Once the site is built, configure the following items:

  1. Search scopes
  2. Search pages
  3. Search tabs
  4. Results pages
  5. Assign scopes to result pages
  6. Results tabs
  7. Advanced Search Pages

Create a Search Scope

Scopes can be created either at the Site Collection level using SharePoint Central Administrator or at the Site Collection thru Site Actions > Site Settings > Search Scopes.

If you need to narrow a scope down to folder level, then use the Site Actions > Site Settings approach. If your scopes are broader and can be handled with Content Sources and Metadata Properties then use the SharePoint Central Administration approach.

Create a New Search Page

  1. From the Search Center
  2. Site Actions
  3. Create Page
  4. Enter a Title, Description and change the URL if desired
  5. Select (Welcome Page) Search Page
  6. Click Create

Create a New Search Tab

  1. Edit the new search page just created
  2. Click Add New Tab
  3. Enter a name for the tab
  4. Specify the name for the search page just created (ex. MySearchPage.aspx)
  5. Enter a tooltip
  6. Click OK

Create a New Results Page

Search pages and tabs work in pairs, for every search page, there must be a matching results page and for every search tab, there must be a matching results tab. A unique results page allows the assignment of unique scopes to a search.

  1. From the Search Center
  2. Site Actions
  3. Create Page
  4. Enter a Title, Description and change the URL if desired
  5. Select (Welcome Page) Search Page Results
  6. Click Create
  7. Edit the new page
  8. On the Search Box > Modify Shared Web Part
  9. Expand Miscellaneous
  10. Enter the name of the new search page created above in ‘Target search results page URL”
  11. Note you will come back after creating the Advanced Search page, to enter it’s URL in the “Advanced Search page URL”
  12. Click Apply

Assign Scopes to Result Page

  1. Continue editing the new results page
  2. On the Search Core Results web part > Modify Shared Web Part
  3. Expand Miscellaneous
  4. Enter the name of the Search Scope created above.
  5. Click Apply

Create a New Results Tab

  1. Still editing the new results page just created
  2. Click Add New Tab
  3. Enter a name for the tab
  4. Specify the name for the search page just created (ex. MySearchPageResults.aspx)
  5. Enter a tooltip
  6. Click OK

Create an Advanced Search Page

  1. Navigate back to the initial Search Center so you are not looking at a results page
  2. Site Actions > Create Page
  3. Enter a Title, Description and change the URL if desired
  4. Select (Welcome Page) Advanced Search
  5. Click Create
  6. Click Add a Web Part
  7. Check ‘Advanced Search Box’
  8. Click Add
  9. On the ‘Advanced Search Box’ > Modify Shared Web Part
  10. Expand Scopes
  11. Check ‘Show the scope picker’
  12. Change the ‘Display Group’ to the correct one
  13. Click OK
  14. Edit the New Results Page previously created
  15. On the Search Box > Modify Shared Web Part
  16. Expand Miscellaneous
  17. Enter the name of the advanced search page created in ‘Advanced Search page URL”. Be sure to include the entire path.
  18. Click Apply
  19. Edit the New Search Page previously created
  20. On the Search Box > Modify Shared Web Part
  21. Expand Miscellaneous
  22. Enter the name of the advanced search page created in ‘Advanced Search page URL”. Be sure to include the entire path.
  23. Click Apply

Be sure the check-in and publish all new and edited pages.

Hiding Edit in Datasheet, Export to Spreadsheet and Open with Access Menu Items

To hide the Edit in Datasheet, Export to Spreadsheet and Open with Access menu items. Create a custom Permission Level using the directions found here.

When specifying the permissions for the custom Permission Level make sure Use Client Integration Features is unchecked, this will prevent users from launching client applications which includes Access embedded in the datasheet, as well as the external applications. Unchecking Use Remote Interfaces is probably a safe bet as well.

Creating Custom Permission Levels

Frustrated by the limit of existing Permission Levels within SharePoint (Full Control, Design, Approve, Contribute, Read, etc.) I finally discovered how to create my own. These are created at the Site level like this:

  1. Site Actions > Site Settings > Advanced Permissions
  2. Settings > Permission Levels
  3. Add a Permission Level
  4. Enter a Name and a Description
  5. Select permissions from the beautiful buffet of security settings are available
  6. Click Create

At this point the new Permission Level is available when assigning permissions to a user or group!

The Perfect SharePoint Document Template

SharePoint is a good Document Management System until you need to embed properties within a document. Once properties are embedded they won’t update until you print, you manually update the fields or you add a macro to update them every time the document is opened.

SharePoint as a Document Management System also falls down when you want to update the template used by documents and have that update affect all existing documents.

The Perfect Document Template

The perfect template will have a macro that updates embedded SharePoint properties whenever a document is opened. And the template will allow me to change the header and footer for all the documents whenever I want. To do this, I need a template that I can swap out whenever I want.

Because of the default behaviour of SharePoint and Word, the template is downloaded once when you open a document. The template is never pulled again from SharePoint. See this reference. This means any updates you make to the template do not pass down to you.

The article refered to from Microsoft above discusses building an XML Expansion Pack, which is overkill for what I need. And in fact doesn’t work with MOSS only WSS.

The simpler solution is to build 2 templates: a driver template and an actual template.

The Driver Template

This is the template that is bound to the Content Type and is the one that gets downloaded and never updated. What this template does is binds the actual template you want to associate with the actual document.

The Actual Template

This template contains code to dynamically build the header and footer and update all the embedded properties.

To Build This Solution

  1. Define your Document Library
  2. Define your Content Type
  3. Create a Driver Template in the Forms directory of your Document Library
  4. Create an Actual Template in the Forms directory as well
  5. Bind the Driver Template to the Content Type
  6. Test

I won’t bother showing you how to create a Document Library or defining a Content Type, but I will show you steps 3 and 4.

Create a Driver Template

Open MS Word.
Alt + F8 will take you to macros
Create a macro called UpdateTemplate
Once you are in Visual Basic, paste this code in the code window:

Private Sub Document_New()

‘temporarily unlink this file from the template
ActiveDocument.AttachedTemplate = “”

‘and update
UpdateTemplate

End Sub

Sub UpdateTemplate()

Dim strTemplatePath As String
Dim doc As Document

‘ Get the path of the template file.
strTemplatePath = “http://sharepoint-test/Docs/MyLibrary/Forms/ActualTemplate.dotm”

‘ Open the document template and save it to the local machine
Set doc = Application.Documents.Open(strTemplatePath, Visible:=False)
doc.SaveAs Environ(“Temp”) & “ActualTemplate.dotm”
doc.Close

‘ Add the template as an Add-in
Application.AddIns.Add Environ(“Temp”) & “ActualTemplate.dotm”

‘ Run the macro in the ActualTemplate template
Application.Run “UpdateThisDocument”

‘ Rest of the lines do not execute.
Application.AddIns.Unload True
On Error Resume Next ‘In case another document is using the template
Kill Environ(“Temp”) & “ActualTemplate.dotm”

ActiveDocument.AttachedTemplate = strTemplatePath

End Sub

Private Sub Document_Open()

‘do not do anything in the case where the solution author opens the template directly
If (InStr(1, ActiveDocument.FullName, “.dotm”, vbTextCompare) = 0) Then

‘temporarily unlink this file from the template
ActiveDocument.AttachedTemplate = “”

‘update template
UpdateTemplate

End If

End Sub

Close the VB environment and save your template.

NOTE: Make sure to save it as a .dotm (macro enabled template)

Create an Actual Template

Open MS Word.
Alt + F8 will take you to macros
Create a macro called UpdateThisDocument
Once you are in Visual Basic, paste this code in the code window:

Sub Document_New()

End Sub

Sub Document_Open()

UpdateThisDocument

End Sub

Public Sub UpdateThisDocument()

Application.ScreenUpdating = False

Margins

‘Header
ClearHeaders
AddHeader

‘Footer
ClearFooters
AddFooter

‘Update Fields
UpdateFields

‘Display Document Normally
If ActiveDocument.ActiveWindow.View.SplitSpecial = wdPaneNone Then
ActiveDocument.ActiveWindow.ActivePane.View.Type = wdPrintView
ActiveDocument.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveDocument.ActiveWindow.ActivePane.View.Type = wdPrintView
Else
ActiveDocument.ActiveWindow.View.Type = wdPrintView
ActiveDocument.ActiveWindow.View.SeekView = wdSeekMainDocument
ActiveDocument.ActiveWindow.View.Type = wdPrintView
End If

End Sub

Private Sub Margins()

With ActiveDocument.Styles(wdStyleNormal).Font
If .NameFarEast = .NameAscii Then
.NameAscii = “”
End If
.NameFarEast = “”
End With
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.TopMargin = InchesToPoints(0.5)
.BottomMargin = InchesToPoints(0.7)
.LeftMargin = InchesToPoints(0.5)
.RightMargin = InchesToPoints(0.5)
.Gutter = InchesToPoints(0)
.HeaderDistance = InchesToPoints(0.4)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
.BookFoldPrinting = False
.BookFoldRevPrinting = False
.BookFoldPrintingSheets = 1
.GutterPos = wdGutterPosLeft
End With

End Sub

Private Sub ClearHeaders()
Dim hdr As HeaderFooter

For Each hdr In ActiveDocument.Sections(1).Headers
hdr.Range.Text = vbNullString
Next hdr

End Sub

Private Sub AddHeader()


‘TODO: Add your header code here

End Sub

Private Sub ClearFooters()
Dim hdr As HeaderFooter

For Each hdr In ActiveDocument.Sections(1).Footers
hdr.Range.Text = vbNullString
Next hdr

End Sub

Private Sub AddFooter()


‘TODO: Add your footer code here

End Sub

Private Sub UpdateFields()

With Options
.UpdateFieldsAtPrint = True
.UpdateLinksAtPrint = True
End With

If ActiveDocument.ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveDocument.ActiveWindow.Panes(2).Close
End If

ActiveDocument.ActiveWindow.View = wdNormalView

‘Application.ScreenUpdating = False

If ActiveDocument.ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveDocument.ActiveWindow.ActivePane.View.Type = wdOutlineView Then
ActiveDocument.ActiveWindow.ActivePane.View.Type = wdPrintView
End If

‘Footer
ActiveDocument.ActiveWindow.ActivePane.View.SeekView = wdSeekPrimaryFooter
Selection.WholeStory
Selection.Fields.Update

‘Main Document
ActiveDocument.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Selection.WholeStory
Selection.Fields.Update

‘Header
ActiveDocument.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.WholeStory
Selection.Fields.Update

End Sub

Close the VB environment and again save your template as a .dotm file.

Bind the Driver Template to the Content Type

Go to your Document Library
Settings > Document Library Settings
Under Content Types, click on your Content Type
Click Advanced Settings
Enter the URL for the DriverTemplate.dotm (http://sharepoint-test/Docs/MyLibrary/Forms/DriverTemplate.dotm)
Click OK

Test

In the Document Library, click New and select your Content Type.
At this point your macro code in ActualTemplate.dotm should have fired. Any header or footer creation should have occurred.

SharePoint Document Property Names

Recently while working on embedding SharePoint properties within a Word 2003 document I discovered some oddities with the names. When working to embed a property named Doc No. I found at times one of the 3 following situations displayed in the Field list:

  1. Doc No.
  2. Doc No. and Document No.
  3. Document No.

If i used Doc No. the value would be incorrect. If I used Document No. the correct value would display and would synchronize.

Upon investigation I looked at the AllLists table in the database to find the row for the Document Library I was using. Examining the ContentType column explained the behaviour. For the field Doc No. this is the value I found:

DisplayName=”Doc No.”
Required=”TRUE” Hidden=”FALSE”
ReadOnly=”FALSE” PITarget=”” PrimaryPITarget=””
PIAttribute=”” PrimaryPIAttribute=””
Aggregation=”” Node=””/>

Notice that the name is Document No. (after decoding) and the DisplayName is Doc No. After seeing this, I remembered initially naming the column Document No. and then shortening it to Doc No. SharePoint obviously retained the original name as the ID of the field and just adds the DisplayName attribute to show the changed value. This is definitely a gotcha and will lead to some confusion for users. But at least the behaviour is now explained.

Documents Not Appearing in Search Results

I recently spent quite some time trying to understand why certain documents would appear in my search results, and others wouldn’t.

I looked at the ‘Always index all ASPX pages on this site’ setting found at Site Settings > Search Visibility. But that didn’t resolve the issue.

I looked at the ‘Allow items from this document library to appear in search results?’ setting found at Document Library Settings > Advanced Settings. But that didn’t resolve the issue.

Finally I noticed that documents that appear in the search results have a major version (1.1) and the documents that do not appear, only have a minor version (0.1). So I published one of the documents, did an incremental crawl, and the document began appearing in the search results.

One mystery solved today.

Causing the Create Site link to Create a Site Collection

If you layout your MOSS intranet with the multiple Site Collections approach, you can simplify the creation of new Site Collections.

There are a couple settings which need to be setup for this to work:

Central Administration

  1. Central Administration > Application Management
  2. Under the Application Security section click on Self-service site management
  3. Turn, ‘Enable Self-Service Site Creation’ on
  4. It is optional to require a secondary contact in this form
  5. Click OK

Site Directory

  1. From within the site directory of the web application, go to Site Settings > Modify All Site Settings
  2. Under the “Site Collection Administration” area, click on “go to top-level site settings”
  3. Under the same “Site Collection administration” area, click “Site Directory Settings”
  4. Check ‘
  5. Click OK

Now when you are the Site Directory, clicking the Create Site link, will create a Site Collection.

Thanks to Dave Wollerman for this tip.