Skip to main content

Kevin DeRudder

Go Search
Kevin DeRudder
U2U Website
  

Talking about .NET, SharePoint, Ajax ...

  U2U Home
  U2U Course Calendar
Talking about .NET, SharePoint, Ajax ...
Jan released new version of the SmartPart

This evening my friend and colleague Jan Tielens released a new version of the SmartPart. For the few who do not know what I'm talking about, the SmartPart allows you to create SharePoint 2007 Web Parts using Web User Controls ( .ascx ) created with the Visual Studio designer.

This version of the SmartPart allows you to install it using a wizard, which makes live much more easy J. There is also support for localization using ASP.NET Ajax controls and User Control samples are added to make you more productive using the SmartPart.

So go and download it from the codeplex community site.

Kevin.

 

Mail merge using SharePoint contacts

When setting up mailings I often use Microsoft Word because it is so easy, write the mail message and select your Microsoft Outlook contacts as recipients. The only problem is that these our my personal contacts. It would be very useful if I could create a SharePoint contact list and use these contacts in my mailing.

This is very easy because you can connect your SharePoint contact list with your Outlook. How you can do this is explained in following steps:

1. Start by creating a SharePoint Contact list and fill  it up with contacts

2. Connect this list with Outlook

3. Open word and start the new mailing wizard

4. Select the type of the mail:

5. select starting document

6. Select your contacts.

Your SharePoint list will be included

7. Insert Text

8. Preview the mailings

Click on the 'Complete the merge' button to finish the mail merge and send out the emails.

Greetz K.

Help on new user interface in office

Before I give office demo's I ask the people what they think about the new user interface (ribbon, tabs, ...). Everybody likes it, but it is sometimes hard to find some stuff back again, specially in the beginning.

If I don't find a feature directly, I use the interactive guide of Microsoft.

With this guide you can select the feature in 2003 and it will show where you can find it in office 2007. FYI, it is a Flash application, probably the next version will be Silverlight, or that is what I hope :-).

 

1. Start the Interactive guide:

image

2. Go to the functionality that you want to look for in office 2007:

image

3. The following screen will show where you can find it in 2007

image

You can even download a tool for excel, powerpoint ...

Kevin.

Some cool Excel tips

One of the chapters that we give in the SharePoint courses is the Excel Services chapter. Before we publish an Excel report to SharePoint, I show some cool things in Excel and from time to time there is a student who knows some tips as well, like today.

Apparently these tips where available in the older versions of MS Excel but I didn't know them.

First one is selecting a table

1

How did I do it:

Use my mouse :-), because the shortcuts that I knew weren't very handy (with page downs and the end button ...). From time to time I end up on row twenty thousand ...

In the new version of Excel, when you select a table, Excel is going to wait for a small second before continue selecting. Normally that should be enough for you, off course this is depending on the distance between brains and your mouse-finger.

How am I going it to do:

She used a shortcut. She selected the first cell of the table and use the 'CTRL + *' key combination. Simple but very handy.

Dragging the selection to the last row

If you use a function and you want to copy it down, or in this demo you want to drag numbers down to the last row you can use a very helpful technique as well.

How did I do it:

Use my mouse (again), select the little square and drag it to the last cell

2

How am I going to do it:

Instead of dragging it, I'm going to double-click on that little square:

3

To end this article, something that I really like. If you have a lot of rows in a table and you scroll down, you loose the headers of the table:

4

You can fix this with having a fixed row, but I don't like that. In excel 2007 there is again great functionality. Actually it is like something very small but it is sooo very nice:

5

By selecting a column in the table and scrolling down, the names of the headers will be placed on top.

So, if you have more of these things, please let them know. It will help a lot of people.

K.

Sharing a Microsoft Office Ribbon tab

At U2U we are currently very busy with creating 'Office Business Applications', an example of such an OBA application is the U2U Email Snippets, and I can already tell you that another great tool is coming up :-), so definitely stay tuned.

Sometimes when you create these office add-ins you meet some challenges or problems. In this article I want to give a brief explanation how you can share a Ribbon tab, so that you can create two buttons in the same ribbon and even in the same group on a tab.

This is also explained on the MS site but, they do it in three pages :-), I'm going to do it in a few lines :-) and some screens off course.

In this article I assume that you know how to create a Ribbon and with the Visual Studio Tools for Office 2007 it isn't that hard to do. So I've created 2 new projects and I've picked the 'Word Add-in' template.

image

When you create a project based on this template you got the files that you need to make an Outlook Add-in. I'm going to add a RibbonSupport Class to the project:

image

Go to the Codebehind of your ribbon, uncomment the partial class and run your program:

1

So the purpose of this article is to have multiple buttons in one tab. The key to success lies in namespaces: We are going to use the same or a shared namespace for the add-in. This is the Ribbon XML at this moment, not shared:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnLoad">
  <ribbon>
    <tabs>
      <tab idMso="TabAddIns">
        <group id="MyGroup"
               label="My Group">
          <toggleButton id="toggleButton1"
                        size="large"
                        label="My Button"
                        screentip="My Button Screentip"
                        onAction="OnToggleButton1"
                        imageMso="HappyFace" />
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

This is with a shared namespace added in the customUI.:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
         xmlns:shared="http://www.u2u.info/blogs/kevin"
          onLoad="OnLoad">

And then we are going to use this namespace in ribbon of the two add-ins:

First add-in:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
          xmlns:shared="http://www.u2u.info/blogs/kevin"
          onLoad="OnLoad">
  <ribbon>
    <tabs>
        <tab idQ="shared:MyCustomTab" label="Kevin">
            <group id="MyGroup"
               label="My Group">
                <toggleButton id="toggleButton1"
                              size="large"
                              label="My Button"
                              screentip="My Button Screentip"
                              onAction="OnToggleButton1"
                              imageMso="HappyFace" />
            </group>
        </tab>
    </tabs>
  </ribbon>
</customUI>

Second add-in:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
          xmlns:shared="http://www.u2u.info/blogs/kevin"
          onLoad="OnLoad">
  <ribbon>
    <tabs>
      <tab idQ="shared:MyCustomTab" label="Kevin">
        <group id="MyGroup"
               label="My Second Group">
          <toggleButton id="toggleButton1"
                        size="large"
                        label="My Second Button"
                        screentip="My Button Screentip"
                        onAction="OnToggleButton1"
                        imageMso="HappyFace" />
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

IdQ Stands for Qualified ID, and this is the id that we are sharing across the multiple ribbons.This will result in:

2

Off course you can go a step further and share the same group:

<group idQ="shared:MyGroup" label="My Group">

3 

So, I hope this one helps you as it helped me :-)

K.

Extending the Holiday Approval Workflow

Waaaaw, I didn't think that my previous post, Create e custom Workflow using SharePoint Designer, was going to be that famous :-), because a lot of questions already came up.

1. Can we directly put it in the calendar

Well in the action where you send the email you can add an action to add it directly in a calendar. You could even connect this calendar with MS Outlook.

setcalendar

2. Can you change the pages created by SharePoint Designer

Well even that is possible. In our workflow, two pages are created. A page to allow a user to start the workflow manually and the page where the Human Resource Manager needs to complete his task.

screen1

Open these pages and customize them to your own needs.

Keep the questions coming: kevin@u2u.be

K.

Create a custom workflow using SharePoint Designer

From time to time I hear from SharePoint users that they always have to wait for their developers if they want to have a workflow that is not available 'Out Of The Box'.

As a respond I ask them which workflow they want to use or have and apparently most of the workflows can be created in SharePoint Designer without writing one line of code.

In this article I'm going to create a 'Content Approval' lookalike workflow, named the 'Holiday Request Approval' workflow (Human Resource managers can thank me later :-)).

Before we open up SharePoint designer, we need a 'Task' list and a 'Holiday Requests' list, which is based on the 'Custom List' template. So the easiest way is to create a site based on a 'Team Site' and add a custom list.

1. screen_ListsinQuickLaunch

In the 'Holiday Request' list we create some holiday related columns, such as 'start date' and 'end date'.

2. screen_ColumnsInList

Now it's time to open up SharePoint designer and load the site where we can find these holiday requests:

3. screen_OpenSiteInDesigner

Once the site is open and loaded, we are going to add a new Workflow by clicking on File --> New --> Workflow button:

4. screen_NewWorkFlow

The cool thing about creating Workflows in SharePoint Designer is, that it's nothing more than running through a wizard and that you can create pretty nice Workflows without writing a line of code.

Wizard Step 1:

In this step we need to provide a title for the Workflow, in our case it is 'Holiday Request Approval'. Next you need to specify on which list or library you want to use it and when you want to start the workflow.

We are going to start it automatically when a new item is created in the 'Holiday Requests' list:

5. wizardscreen_step1

Wizard Step 2:

When an employee adds a request for a holiday, we need to create a task for the Human Resource manager who needs to approve or reject the request.

So we need to create a kind of special form where the manager can select his choice. Because I don't want to write one line of code I'm going to let SharePoint Designer create the form.

At the end, the form will look like this:

36. Whooow

So the action that we are going to use is the 'Collect Data From User' action:

6. wizardscreen_step2_CollectDataFromUser

7. wizardscreen_step2_CollectDataFromUserLine

As you can see on the screen above, you need to provide three things:

  1. The data that needs to be collected
  2. The user that needs to provide the data, the human resource manager
  3. A variable to collect, I'm coming back on this later ...

 

data

First click on the data link and a new wizard will pop up:

8. wizardscreen_step2_datawizard1

8. wizardscreen_step2_datawizard2

We need to collect 2 things from the human resource manager:

  • Can the employee go on holiday or not?
  • Some extra comments

Click on the add button to add these two questions on the page.

10. wizardscreen_step2_datawizard3

First question is the status where we are going to use a choice field so that the manager can choose between Approve or Reject:

11. wizardscreen_step2_datawizard3_1

12. wizardscreen_step2_datawizard3_11

Click Finish and add another field to make it possible for the manager to add some comments:

13. wizardscreen_step2_datawizard3_2

14. wizardscreen_step2_datawizard3_22

15. wizardscreen_step2_datawizard4

Once you've added these two fields click on the Finish button to complete the data part of the action.

 

User

The next step we need to tell who the human resource manager is so a task can be assigned on his name

(because I always wanted to approve a holiday, I will play the manager for now):

 16. wizardscreen_step2_thisuser

17. wizardscreen_step2_thisuser_1

 

Variable to collect:

What we've actually done is, we've created a task for the human resource manager (me) to approve or reject the holiday.

Because we want to use the outcome of this task we need to save the ID of the task that we've created. This is is the variable that we want to collect.

We are going to store the ID of the task in a new variable which we call HolidayRequestTaskID:

18. wizardscreen_step2_newvariable

19. wizardscreen_step2_newvariable_1

Once we've completed the first action we need to save the respond of the human resource manager. With respond I mean, what is the status and what is the comment that the manager gave.

To save these responds we need to create 2 variables and store the responds in these variables.

Find the Action 'Set Workflow variable'. If you don't find it click on 'More Actions...'.

20. wizardscreen_step2_NewAction

21. wizardscreen_step2_SetWorkflowVariable

22. wizardscreen_step2_SetWorkflowVariableOverview

We have to do this 2 times, once for the approval status and once for the comments status

Variable 1

First we are going to save the answer of the first question, which is the approval status, in a new variable:

23. wizardscreen_step2_SetWorkflowVariable_1

Fill in the Name of the variable and the type of content you are going to store in the variable:

24. wizardscreen_step2_SetWorkflowVariable_2

Click on OK, you should be having something like this:

25. wizardscreen_step2_SetWorkflowVariable_3

We've created the variable now, but we didn't tell the variable what he should keep. Click in the 'fx' button which will open up a new dialog:

26. wizardscreen_step2_SetWorkflowVariable_4

What do we want to collect? Well we want to collect the things that the human resource manager provided in the task that we've created earlier.

How do we know which Task that was, because there could be more than 1 task? Remember that we've saved the ID of the task in a variable, see 'Variable to collect'.

So in the Source drop down box pick 'Tasks' as the selected source. Once you've selected the task list, you have to look for the 'Holiday Request Approve Status' field which we've created earlier. In this field you find the answer of the first question.

Because there could be multiple tasks in that list you need to tell which task you would like to use. Get the task with the ID that you saved before.

27. wizardscreen_step2_SetWorkflowVariable_5

this ID is saved in the 'HolidayRequestTaskID' variable which you can load by using the 'fx' button and choose for Workflow Data.

afterwardsadded

Once you've setup all the fields click OK and do the same for the comments question.

28. wizardscreen_step2_SetWorkflowVariable_6

Wizard step 3

Next we are going to create a new Workflow step. You can do this by clicking on the 'Add workflow step' link on the right side of your screen.

29. wizardscreen_step2_AddWorkflowStep

In this step we are going to check what the manager filled in. To do so we are going to compare the answer. The condition that you need to use is the 'Compare any data source':

30. wizardscreen_step3_CompareDataSource

In the first option you are going to select the variable where you stored the answer of the first question in, which is HolidayApproved:

31. wizardscreen_step3_CompareDataSource2

and in the value part you type 'Approve':

32. wizardscreen_step3_CompareDataSource3

If this condition is true, you can do a lot of things:

  • update a field
  • add the holiday to a calendar
  • ...

We are going to keep it simple and send a mail to the requester of the holiday. So use the actions button to select 'Send an Email':

33. wizardscreen_step3_SendEmail

You want to send an email to the person who created the item. So next to the 'To' textbox, click the addressbook button. One of the users that you van pick is the 'User who created current item':

34. wizardscreen_step3_SendEmail1

Complete the other fields in the send mail dialog box:

35. wizardscreen_step3_SendEmail2

Once this is done, click OK.

Normally you will do an action if it is not approved.

Last step

Finish the creation of the Workflow and add a new item in your list, if everything went right you should have a new task created for the human resource manager that you've selected.

36. Whooow

So, I've hope that I could show how you can create some more advanced workflows in SharePoint Designer.

K.

More help on formulas

Some time ago I've posted some articles on formulas and some link to online resources. Recently I clicked on the SharePoint help button which you find on the right top side of your SharePoint page.

helpbutton

This will pop up a dialog box where you can navigate to an overview of all the available functions:

Formulas

Navigate to by clicking on: Business intelligence/Business Data in sites, lists and libraries and than on Formulas and functions.

K.

U2U Email Snippets

Tired if writing emails over and over again? Well at U2U we released a cool new Outlook add-in which allows you to store ready-made email messages in a SharePoint list. Afterwards you only need to insert the snippets in your email messages.

emailsnippets

If you want to read more or download it: click here

Generate email address automatically

Today I had the question if the email address could be generated automatically in a contact list. The reason for this question is because the email address is just a concatenation of the first name and the last name and the company added to it. So in my case would this result in 'kevin.derudder@mycompany.com'.

 

With the calculation field this is a piece of cake. So Start by creating a contact list and add a new column to it based on a calculation field.

In the formula text field, type following formula: LOWER(CONCATENATE([First Name], ".", [Last Name], "@mycompany.com" ))

email

This will result in:

overview

1 - 10 Next

 Training Schedule

There are currently no upcoming events.

 ‭(Hidden)‬ Admin Links