Monthly Archives: September 2015

Copying from Word into a Content Editor web part? Please… just don’t.

This is a bit of a “drive-by” blog post, in that it’s not overly techie in nature. It’s just a plea to those who figure that pasting content into a Content Editor web part directly from Word is a great idea…

Please don’t. For both your sake and the sake of your SharePoint support person.

When you put content into a Content Editor web part, SharePoint generates all the HTML code behind the scenes so that things render pretty much like you see it on the screen… also known as WYSIWYG (pronounced whizzy-wig, and stands for “What You See Is What You Get”)

When you copy content from a Word document, it’s actually pasting the Word HTML into the web part, so now you have both the Word HTML *and* SharePoint’s HTML. Sometimes they play well together, and sometimes… they don’t.

If someone calls me and asks for help making a bulleted list look right because the third and fourth bullet have different spacing and they can’t seem to fix it, it’s usually because they copied the original list from Word, and then they tried to edit the list in SharePoint. Different HTML, different spacing…

If you’re hardcore and up to the task, you can open the Edit HTML option and wade through all the HTML, removing extra Word styling and tags. It’s not fun.

Or, you can take the content, copy it to something basic like Notepad, erase all the existing stuff in the web part, and then paste the non-formatted text back in. Format it within SharePoint, and things will be consistent.

I want your page to look good just like you do. But I really don’t want to take dozens of lines of HTML and clean things up for you. Just don’t copy directly from Word if you want to update the page in SharePoint later on.

Do you pick your technology, or does your technology pick you?

This is one of those topics that I’ve been close to, both from an observation perspective as well as my own career.

As a “technology person”, people expect you to know everything (or learn it quickly). It’s possible to be aware of a large number of technologies but most people end up concentrating on a few specific areas that pay their bills. There are rare people that seem to pick up everything, but I’m not that person. The question for most IT people is… what technology do I focus on, and when should I decide to learn something new (or drop something that I already know/work with on a regular basis)?

It seems like there are two scenarios that play out in my mind. If you’re a consultant, you’re always trying to ride the bleeding edge of what’s in demand and what will keep you employed. If you’re working as a regular employee, you’re focused on working with whatever technology keeps you employed.

I’m going to step back into my Notes world as an example… mainly because I went through this. As a Notes developer, it was my job to make sure I knew as much as possible about Notes development. That could mean just Notes client development, but it also included web development as well as XPages as the Notes environment evolved. It used to be you could focus on Formula language and sort of ignore LotusScript. Then it was needing to know LotusScript but XPages was still a nice to have. Now it seems you have to know XPages, and client development is sinking quickly as an in-demand skill.

As a regular employee in an organization using Notes, I focused mainly on Notes client development, as we had a lot of that. When I found myself unemployed and headed into the consulting/contracting world, I found that I wished I knew more about web development, portals, XPages, etc. When I was able to get re-employed by my original company, I was back in my sweet spot of client development again.

While I would have been happy to continue to do that and push those limits, life had different ideas. We moved from Notes to SharePoint, and now SharePoint is my primary focus. Much like Notes, saying you’re a SharePoint developer can been a variety of things… out-of-the-box development, SharePoint Designer workflows, JavaScript web development, C# coding, etc.

To the point of my title… I could take a step back, decide that I think Hadoop, big data, and Python are where it’s at, and start planning my post-SharePoint technology life. I could also look at all the options available to me in the SharePoint and Office 365 world, and push myself within the arena that I’m already familiar with.

I think it’s important to keep an eye open to where IT trends are going, but no one has a crystal ball. Telling someone they need to leave their current technology may make sense from the outside looking in, but sometimes that technology picked you given where you’re at and the opportunities that are available.

Keep your eyes and your mind open to where things are going, and take a realistic look at the future of your organizational choices and your personal career. Then decide… do you need to pick your technology, or are you OK with the fact that your technology picked you?

How did I miss “Enable enhanced rich text content such as tables, images, and hyperlinks”?

I have a customer testing a new custom list that tracks policy and procedure reviews. The form has been altered using the Customize Form button that opens up InfoPath (yes, I love InfoPath!). Everything has been going well, except for a certain enhanced rich text control on the form. The customer reported that they did not have any way to make a hyperlink in that field.

It’s set up in the list to be a multi-line text field that uses rich text (so I can allow for hyperlinks). I have another field that’s set up the same way. On the form, the second field works just fine. You go into the field, highlight a word or phrase, and you get the option to make it a hyperlink in the Ribbon Bar. But that first control… not so much.

I checked the list and they were identical in how they’re set up. I checked a list item and there were hyperlinks in both fields. Looks like it works to me. She replied that she must be doing something wrong, as she wasn’t getting the hyperlink option. I went out there in a new item, and guess what… I wasn’t getting the hyperlink option either.

When I started looking at the properties of the control, I found an option that I guess has always been on by default, and I’ve never really noticed it before:


It was unselected in my problem control, and that’s why I wasn’t getting the hyperlink options. When I selected that option and republished the form, it worked just like the other control did.

Lesson… pay attention to *all* the properties, even the ones you normally overlook.

One reason for “This task could not be updated at this time”

I really like the SharePoint 2010 Approval workflow, as it provides a lot of functionality for not very much work. The out-of-the-box one is a bit limited, but it works if you take it for what it is. The version you can use in SharePoint Designer is nicer as it gives you a lot more flexibility in what you do and don’t do based on what happens.

One of my workflows is used for approving standard IT procedures, and today I got a question from the site owner. Someone was trying to approve a task that they received in Outlook, but they got the following error:


That’s not terribly descriptive, and at first glance I didn’t have a clue as to what was different for this person since everyone else seemed to be working fine.

At least for this instance, the problem was caused by the person only being in a permission group that granted them Read access to the site. They could get the task and call it up, but the approval or rejection would fail with the above error message.

Fix… just put them in one of the permission groups that had at least Contribute level access.

Don’t always assume things are what you believe them to be…

I had one of those “duh” moments today…

I had a report from a customer who was claiming that a link to a document in an automated email was broken. Since the email was generated from an InfoPath form when the form was submitted (and presumably saved also), I had my doubts. However, when I went to the library and checked for the document, it wasn’t there. No recycle bin, the submitter had Contribute access without delete…

… or so it appeared.

It turns out that the person submitting the form is one of two people who share the same name. I saw “her name” in the permission list, and assumed all was well. But when I finally noticed her picture compared to an email picture, I noticed they were two completely different people. The person who was submitting the form didn’t have Contribute access, so the email would send but the form wouldn’t save.

Note to self… never assume that everything is as you believe it to be without double-checking the obvious.

Displaying a PowerPoint slide in a Page Viewer Web Part

Bottom line… this is FAR more difficult than it needs to be… 😦

The straightforward (and intuitive) way to do it would be to create a new page and add a Page Viewer web part:20150921Image01

Next, go out to one of your document libraries, open up the PowerPoint file in browser mode, and get the URL:20150921Image02

That gives you a URL that looks somewhat like the following:

No problem, right? Actually, major problem, as it gives you the following error:20150921Image03

What you have to do instead is search the page source code to find the iframe tag. It’s within there that you’ll find the actual code you’re looking for:20150921Image04

In this case, the iframe code for my PowerPoint file is:

PowerPointFrame.aspx?PowerPointView=ReadingView&d=F4d0845e366cf4196adc344c19238f728md26da0e52012465c8dbe3c9d5cafe974m07df9f35b715495798c790767e0515a8m&source=http%3A%2F%2Fdomain%2Ecom%2Fsites%2FDuffTeamSite%2FShared%2520Documents%2FForms%2FAllItems%2Easpx” width=”100%” height=”100%” style=”position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px;” frameborder=”0″>

From that, you have to take a snippet of that code above (in bold green) and add the bold purple code below to get the following for your page URL:


Once you have that completed, you can use that URL as the address for your web page to show (in this case, your slides):20150921Image05

To get it to be a bit more visible, adjust the height and width parameters of the web part:20150921Image06

This is how I have to set up PowerPoint page viewer web parts in SharePoint 2010. I certainly hope it gets more intuitive in upcoming versions.

Comparing People Picker names to blank values? I use a BlankName field…

Much like I suggested in my Empty Date Field post, I’ve found myself starting to add EmptyName as a column to some of my lists that require comparisons (usually during workflows) to blank values. I just find it easier to know I’m going to match up exactly to what a blank people picker field will look like.

Just create a column in the list, name it something like EmptyName, and leave the default value as blank. Then use that field as the comparison value to any of your other names that you’d like to check against.

Want to compare a field against a blank date? Put a blank date in your list…

This is sort of a “why would you do that?” thing, but it’s saved me a lot of time when it comes to SharePoint Designer workflows.

I’ve always had problems trying to compare a variable in the workflow against a blank date, because every date variable wants you to populate it with the current date or some other set date. Furthermore, there’s no “Is Empty” as a comparison option.

I know you can compare the string to some magical date of 1/1/0001, but I’m always afraid I’m going to make a typo or that default date is going to change some time in the future. Instead, I prefer to let SharePoint do the work for me.

I create a list column with the name of EmptyDate and I don’t give it a default value. Therefore, when it comes time to compare dates, I already have a blank date field in the list that I can use for the comparison. Since I normally customize my list forms using InfoPath, I just choose not to put that field on the form.

I don’t have to remember any magical dates, nor do I have to worry about anyone coming behind me and messing up that value by adding leading zeros or something. It just works. 🙂

Multi-line text fields, character count limits, and scrolling… that was unexpected.

So I got this request to make a multi-line text field scroll in one of my forms. That sounded easy enough. But there seems to be a problem when you also have a line-character length set. If you set a line character limit, it greys out the ability to set it as a multi-line field.

To get around that, I decided to hack the field validation a bit. Instead of using the character limit count in the list item, I used an expression in the validation rule to check the character length and fire an error if it’s over 320 characters:


That was the magic combination to allow the text to scroll down in the field, while still limiting the number of characters allowed. Instead of just stopping at the 321st character, it fires a validation error if it goes over that length.

Not quite as clean as the character size limit field on the list item, but it works.