Comparing two documents in MS Word

Today I was sent two documents by two people in the same department. One was a revised version of the other. Neither file had tracked changes turned on, and so I had no way of knowing the differences without using the handy dandy Compare feature inside Microsoft Word.

As much as we like to complain sometimes about Microsoft and some of the thinking behind some features, sometimes you really have to take a moment to thank them for building all this neat functionality that makes our lives easier.

Comparing two documents

Under the Review Tab in Microsoft Word, click the Compare dropdown in the Compare section of the ribbon.

Then choose “Compare”


You then pick the original file, and the revised file. The only thing I wish it would let us do at this point of the process is pick from currently open documents instead of making us browse to the files, but that was just a minor inconvenience.

Clicking on the “more” button gives you more features to choose from as to what you actually want to compare. You may not care about white space or case changes, or perhaps you want to ignore headers and footers. By toggling these expanded features you’ll be able to customize the level of detail you get upon comparing.

This screen shows a blurred version of the results. The main portion shows the changes marked in blue, and then on the right hand side you see both the original (on top), and the revised copy (on bottom). Scrolling and moving the cursor in the main document also changes the view on the side panels, which is nice. Comparing also turns on the Revisions pane where you can see all the changes that were made by the individual.


Data Manipulation – Find & Replace and Text to Columns

Data manipulation seems to be an almost daily occurrence for me. Well, maybe not daily, but I do it so often that I don’t even think about it anymore.

IT is supposed to be this always-working, man-behind-the-curtain magical thing, and while it works – it’s awesome. When it doesn’t work, however, we’re stuck either working around it, or fixing it.

The other day someone sent me an email address list in the body of an email. Well, it never came across, so I had the person put it into a Word Document and send me that.

What I didn’t know, was that the Word Document now contained a table. Oh well – copy and paste that into an Excel sheet, and it did just fine.

Now, I had an email address in the left hand column, and then I had a full name surrounded by (parentheses). Why??

OK, so now I have (Mickey Mouse) in my Excel file

First I need to remove the parentheses. How would we go about doing that?

Well, I could have used Text-to-Column but in this case I just used Find and Replace. (Ctrl+H) is the keyboard shortcut for that.

Find and Replace

I had to look for the actual ribbon controls, which are under the Home tab, in the Editing section. Click Find & Select, then Replace.

Enter the ( character in the Find What, and leave Replace With blank so that it will just remove the character from your text. Click “Replace All” to remove all the parentheses. Then do Find & Select and Replace again, and enter the ) character in the Find What.

Text to Column

A lot of the time, I need to split the full name into two columns, with first and last name. One of the easiest ways I know to do that is to use the Text to Column feature, which  you find under the Data tab.

On the first Wizard screen, choose Delimited. On the second screen, add a checkbox for “Space”.
Note how the preview splits out Mickey from Mouse? That’s what you want.

Now this is not foolproof, because if there are middle names, or a surname that contains a space, you need to clean up the data. You could do that using the Filter feature if you have a large list, or you can eyeball it if the list is fairly small.

In looking up this blog, I realized I haven’t done any posts on Filters yet. Shame on me! I’ll spend some time in the next few posts on what to do with Filters. They are incredibly powerful and I use them often.

Community Site Setup Customizations

Customizing Subject View

In SharePoint Designer, in lists and libraries, click Discussion List.

SharePoint Designer: Discussion List

Under views, click on Subject.

SharePoint Designer: Subject View

In the code view, change ReadOnly=”TRUE” to ReadOnly=”FALSE”

SharePoint Designer: Behind the Scenes Code - highlighting ReadOnly=TRUE

Creating a Worfklow to set Category ID

​In the discussion list, go to the LIST tab, then choose List Settings

I named the column CatID

Make it a Number field

Uncheck “add to all content types” – we want the item to be hidden from all input screens.

You are free to Leave “add to default view” checked. – I don’t think this really matters because the default view is Subject anyway, and it doesn’t really show anything with the CATID in there.

Do NOT require that this column contains information – it will be completed by a workflow. We don’t want users seeing this item.

CatID: Number type

Within SharePoint Designer, open the site, and click Workflows on the left menu.

Click on List Workflow, then choose discussion list

Workflows: List Workflow - Discussion List

Give the workflow a name – keep it short, since it will be the name of a column later.
Write a detailed description so that you will know what the workflow is meant to do.

In this following screen, make sure you select all the Start Options because you want this change to always be made, whether it’s a new discussion item, or a changed discussion item.

Workflows: Workflow Screen

Click on Stage 1 and rename it to SetCatID (again, keep this short)

Workflows: Set Stage Name

From the Action Dropdown, pick Set Field in Current Item

Workflows: Action - Set Field in Current Item

Click on Field and choose CatID from the drop down menu

Workflows: Set Field in Current Item

Click on Value, then the 3 ellipses to open the lookup window

Click on Add or Change Lookup

From the Data Source Drop Down, choose Categories

From the field from source field: choose ID (you want the value from the ID column in the Categories table).

Workflows: Set Field in Current Item

Under “Find the List Item” choose Category name as the field, then click on the fx button and select Category

Workflows: Set Field in Current Item

You will get a message saying that you may not get unique values, click YES.
What it’s saying is that if we have two category names that are identical, it would only show the number for the first one.

In the string builder, you will see only this. Click OK.

Workflows: String Builder

Right-click the Transition to stage section and choose go to a stage
Click on go to stage and choose End of Workflow

Workflows: End Workflow

Check to make sure there aren’t any errors by clicking the Check for Errors button. Then hit Publish.

Test your new workflow by creating a new discussion item, or changing the category on an existing item.

You may need to add the CatID field to the Management view in the discussion list so you can see it populate.

You may also want to add the Set CatID field to the management view for testing purposes.

Finding your spot in the SharePoint HTML source code

SharePoint has a view quirks that may require you to go to into the HTML source code of a page.

NOTE: If you’re not familiar with HTML code, you should probably not be in the source code of SharePoint. Ask someone who is familiar to do this for you.

At work I have a tutorials page where I categorized all the tutorials by topic and color-coded them by difficulty. The little monkey faces show you if something is green iconeasy, yellow iconmoderate, orange iconchallenging, or… red iconwell, do not try this at home – or at least not without supervision.

When adding tutorial links to the tutorials page, I often find it easier to be in the source code because I already have all the settings back there. All I need to do is find a spot, and enter the HTML code below:

<img alt="green icon" src="/sites/dsa/sp/greek/SiteAssets/monkey-green-15.png" style="margin: 0px 5px;"/><a href="/sites/dsa/sp/greek/Lists/Posts/Post.aspx?ID=XXX">Tutorial Title</a><br/>

where XXX is the post ID from my blog.

The settings I am referring to include the location of the image, the img alt tag, and the margins of 0px and 5px.

By going into the source code and copying and pasting, it saves me the steps of looking for the image by using the INSERT Picture menu, and then setting the image alt tag and the margin settings.

Finding the location of the HTML content you want to change

This tutorial is to share a tip on how to “find a spot” to paste the content. If you just open the page, hit edit, and then go to Edit Source to get to the source code for SharePoint, you’ll see all the code from the beginning of the page. Finding the spot to paste your content can be tricky to find this way.

A little trick is to place your page in edit mode, and then select a word or two near the spot where you want to paste your content before selecting the Edit Source button. Doing so will take you directly to your content, so you can add your HTML code in that vicinity.

SharePoint: HTML Source Code

I have used this trick more times than I can count. Though visually, it’s very helpful to do so, you don’t necessarily have to highlight a word. Just placing your cursor on the page will send you to that spot in the code also. I just find it easier to take that extra step to highlighting something so I can be sure of my place where I need to be before I change the code on the back end.

Hiding the column headings

Hiding headers in SharePoint can be very handy when you don’t want that “Spreadsheet” look. It’s also a useful feature for when you have created some “Group By” or other out of the ordinary views, and the header row just kind of hangs out there.

To hide the header row, create a Snippet Editor web part from the Media and Content folder and add the following CSS snippet.

<style type=”text/css”>
.ms-viewheadertr {display: none; }

Creating Leave Approval Calendars – Part Two

In the previous tutorial we covered the mechanics of creating the approval workflow on your calendar. Now we’re going build the user interface to where it’s more accessible for your users.

Create a Calendar view showing Approvals only

We want the calendar on SharePoint to only show approved leave, so we need to create a view that only shows approved leave.

You can edit the Calendar view if you wish and just add the filter piece to it; I prefer to create a new view based on the Calendar view, and then called it Approved, and set that as the default view.

Then scroll down to the filter area and set the Approval Status field is equal to Approved

SharePoint: Approval Calendar View

Set the default view for Approval Tasks to be Active Tasks

You do not need to see old requests when you go to the Approval Tasks screen. You only want to see current items so you can approve or reject them.
Click on the Active Tasks link next to All Tasks, then once your active tasks load, go to the LIST tab and choose Modify View. Click the Set as Default checkbox and save.

Create pages that do not allow general users to see the back end of the SharePoint lists.

In general, within SharePoint you can click on a web part header to go to the back end of the SharePoint list. Because leave requests can be sensitive in nature, you don’t want the general population to be able to do that and gain access to submitted requests.

To combat this ability, create separate pages for each of the users, and then add the web part views to them, with Chrome Type = None. That way users can see the content of the page, but unless they are familiar enough with SharePoint, and have the necessary access, they won’t be able to see the back end.

You can get to the pages screen by going to the Site Contents and looking for SitePages. Else, you can click on the PAGE tab, and then View All Pages.

Calendar Page

You may want to add instructions to the calendar page on how to use it. In my blog post about how to break SharePoint I warn you about editing the actual calendar page. Therefore, create a new page, call it Calendar, and then add the calendar web part to it. Under Edit Web Part, choose the Approved view, and then under Appearance, set Chrome Type = None.

My Leave Requests

Create a new page, call it My Leave Requests, and then add the Task list web part to it. Under Edit Web Part, choose the My Leave Requests view, and under Appearance, set Chrome Type = None.

Side Note…

You could also create a page with both the Calendar and the My Leave Requests web parts on the same page.

Leave Approval – Pending Requests

This page will be hidden in the navigation from everyone except the Approvers Group using the Target Audience setting in Navigation.

It contains the Tasks web part, with the Active Tasks view. I recommend you do not turn off the Chrome Type on this one so that if they needed to, the Approvers could click on Tasks and get to the back end if they needed, to possibly reverse a request response, etc.

Update the Workflow

To complete the process, we need to make a final change to the workflow itself to add a link to the Leave Approval – Pending Requests Page.

The email that is sent to the approver generates a link to the calendar item that was added. On the calendar item, there is an option to approve or reject the request. If the approver only uses that function, it does not close out the task on the task list. Therefore, we want to train the approver to go to the Leave Approval – Pending Requests page that contains the Active Tasks view.

Return to Workflow settings, and click on the name of the workflow (Leave Requests)

On the second screen, under the Request field, add the link to the Leave Approval – Pending Requests page such as shown below.

A request for leave is waiting for approval. To view details of request click on the link at the bottom of the page.

However, to actually <a href=”***/****/SitePages/Leave%20Approval%20-Pending%20requests.aspx”>approve request please use this link</a>.

Update Site Navigation

If you went through the steps of creating all the pages above, and thus hiding the built-in functionality of allowing users to get to the back end, then before you deploy the solution to your group, you will want to remove your apps from the navigation, and add your new pages to the navigation in their place.

Rather than going directly to Navigation and removing the links to the apps there, I suggest you go to the list settings for both the Calendar and Task apps, clicking on the Name & Navigation link and removing them from the Quick Launch. There can be an unintended consequence of having to manually add links in the future if you just remove them from Navigation.

Once you have set the apps to not show on Quick Launch, go to the Navigation menu by going to the Gear, then Site Settings, then Navigation.

In the Local Navigation, add the pages to the navigation. Use the Browse feature or just copy and paste the URLs from another browser window.

For the Leave Approval – Pending Requests page, use the Audience: field to restrict the link to that page. Click on the address book icon, search for your Approvers group, then add them to the audience. You also want to add the site collection administrators group, and if need be, your own site owners group.

SharePoint: Navigation Target Audience

Creating Leave Approval Calendars – Part One

In this post we will be creating an approval workflow for a leave calendar. Some departments and companies have a leave request submission process, often accomplished via paper forms that are submitted, reviewed, and then signed by the authorized person. Sometimes the approval comes back to the requestor, sometimes it doesn’t. There’s a better way… SharePoint to the rescue!

This tutorial involves quite a few steps, but they are all completed using the SharePoint browser window, which should make it accessible to all site owners. This tutorial assumes you know your way around SharePoint and does not include screen shots for every step.

Step One: Make sure you have a group on your site with Approver as one of their statuses.

If not, you can grant approver status to an existing group, or create a new group and give the new group Approver status.

Step Two: Create a new calendar.

You can also use an existing one if you’re not using it for anything else, but you generally want to create a new calendar for this purpose. Go to the gear, then Add an App. Give it a one-word name, then later in the settings, change the name to something more friendly.

Step Three: In the versioning settings, set Require content approval for submitted items? to Yes

SharePoint: Versioning Settings

By adding the versioning, SharePoint automatically creates a view for Approve/Reject items. It also creates a view called My submissions.

By default, the “My submissions” view does not actually have the filter set up to only show Created by is equal to [Me]. You’ll need to add that if you want that feature to work.

Step Four: Create your approval workflow.

You can find Workflow settings in the Calendar Tab, or from the List Settings page.
Click Add a Workflow to get to the Workflow screen. The image below shows a Change a Workflow screen, but the screen is the same. Fill in the details as shown below, with the exception of the CC field – please put your own name there, and not mine. You will also edit the request field later, but for now, this is good.

Approval Task List

When you create an approval workflow, it generates a task list and a workflow history list if it doesn’t already exist. When you first create an approval workflow, you probably only have the option to choose Tasks (new), and that’s ok. Do that, and then go to the list settings and rename it later. While you are in there, you may also want to display this list on the quick launch for now.

Final Touches

While you’re done with the creation of the workflow piece, and it will work now, you’re not done yet. There are a number of things that need to be done for the final touches of this process, which are covered in the next post.