AutoHistory for Word 2007

I’ve created a new little tool, which is called AutoHistory (for Word 2007).

I got the inspiration from Visual Local History for Visual Studio. This tool automatically creates a backup every time you save a file.

AutoHistory now provides the same functionality within Word 2007. Everytime you save your document (and something has changed), a backup is created.

From now on you will never lost important information. You can restore every version you’ve ever saved, even if you do not use a version control system (like Team Foundation Server or Subversion).

This tool is fully integrated in Word 2007 within the View Ribbon:

 image

If you check the checkbox you will see all saved versions of the current document:

image

Within this taskpane you can easily view and restore every version.

You can download the setup from here: http://mwiedemeyer.de/downloads/AutoHistory/AutoHistorySetup.zip

Please feel free to drop me a line, if you have any questions or suggestions: mail at mwiedemeyer dot de.

The file is not checked out. You must first check out this document before making any changes.

If you ever got this message and don’t know where it came from, here is the solution.

I got it if I click on “Edit Page” on a publishing page. So after some investigation it seems to be a problem with the web parts on the page.

My page layout contains some EditModePanels, so the user have different views in display and edit mode of the page. Therefore we also have one web part in a web part zone which is in one of the EditModePanels for display only.

<PublishingWebControls:EditModePanel PageDisplayMode="Display">
  <WebPartZone ID="zone1" ...>
      the web part added through the onet.xml site definition

The same web part zone “zone1” does not exists for editing, because I do not want the user to edit the web part. There is another web part zone “zone2” which lives outside of any EditModePanel.

Now comes SharePoint.

If you check out the page and then click on “Edit Page”, everything is working. Except of, that the web part from zone 1 has moved to zone 2! Automatically! Thank you SharePoint…

It seems that SharePoint think it has to show the web part in edit mode. And because the original web part zone is not visible, SharePoint moves the web part to the next available zone which is visible also in edit mode.

So remember:

Never put a web part zone in an EditModePanel which is only visible in display mode.

Maybe the solution is to make the web part not editable, but I didn’t tested this. My fast workaround hack is to create a div instead of the EditModePanel and makes it “runat=server” and give it an ID. Then I wrote this code on top of the page:

<script runat="server">
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    this.navleftdiv.Visible = (this.SPWebPartManager1.DisplayMode == WebPartManager.BrowseDisplayMode);
}
</script>

Now it works like a charm.

Publish a page with onet.xml as “published”

If you ever tried to publish one or more pages with your site definition (by onet.xml), you see in Visual Studio (with the SharePoint XSD schemas selected) only one valid value for the “Level” attribute which is “Draft”:

image

But for this attribute you can choose between every value of the SPFileLevel enum. So for publishing the page automatically, set the Level to “Published”. Thats it.

If you already know how to enable XSD schema validation and IntelliSense support stop reading here.

Enable Schema Validation:

  1. Open your xml file, e.g. onet.xml (works with all SharePoint related xml files)
  2. In the property pane, click the ellipsis next to the “Schemas” property
  3. Add the wss.xsd. This file is located in the 12\Template\XML directory
  4. Now add the following xml Namespace attribute to the root element (here Project in onet.xml):
  5. <Project xmlns="http://schemas.microsoft.com/sharepoint/" Title="" [...]
    

Now you should have IntelliSense and schema validation enabled.

SharePoint Page Version History without Web Parts

Today I found a version history “bug” in SharePoint publishing pages:

The version history system of SharePoint covers only Page Fields, but not Web Parts.

In detail:

  • Create a new page (e.g. “Blank Web Part Page”) within a publishing web.
  • Now add text and a Web Part. Save changes and check-in.
  • Check out and change the text and some properties of the Web Part.
  • After that, check-in again, and open the “Version History”

If you now try to recover the first version, it seems to work, but only the page fields are recovered. The Web Part is always the latest version, because the Web Parts are saved in a totally different location, so they are not covered by the version history system.

Lets have a look on a cool solution:
Garry Lapointe created a web feature which replaces the version history system and saves a whole page with all Web Parts on every check-in through an Event Receiver on the Pages list.
The version is Alpha 0.0.1 but it is working very well, so download it from codeplex.

Telerik RadEditor for SharePoint: Problem with custom tools

The RadEditor for MOSS 2007 version 4.5.3.0 has a Bug, which is very annoying...

You create a new custom tool in the ToolsFile.xml and set the “showtext” property.

<tool name="CustomToolName" showtext="true" /> 

Then you create a corresponding javascript method in the RadEditorCommandList.

RadEditorCommandList["CustomToolName"] = function(commandName, editr, oTool)
{
  (...)
}

If you now click on this new Tool Button, the RadEditor shows the message “Could not find the command xxx. Please update your command list.”

radeditor_error

The solution for that: Remove the “showtext” property from your tool in the ToolsFile.xml and everything is working as expected.

.NET Framework 3.5 SP 1 und SQL Server 2008

Seit heute habe ich das Service Pack 1 für das .NET Framework 3.5 und den SQL Server 2008 auf meinem Server installiert. Ein paar neue kleine private Projekte warten und können nun mit den neuen Features ausgerüstet werden (z.B. Entity Framework und auch ASP.NET MVC obwohl das nur eine CTP ist).

An der Stelle kann ich das .NET 3.5 Enhancements Training Kit empfehlen! Sehr guter Überblick über alle Neuheiten.

Außerdem werde ich vielleicht die Datenbank von WoIstMarco? auf die neuen SQL Server 2008 Geo Datentypen upgraden. Mal schauen, was das so für Vorteile bringt.

Jetzt brauche ich nur noch viiel Zeit...

Error creating a new SharePoint Site through the Object Model

I have an issue creating a new Web Site programatically. Sometimes, the following exception occurs:

Content type '0x01010007FF3E057FA8AB4AA42FCB67B453FFC100E214EEE741181F4E9F7ACC43278EE811' not found in web 'xxx'

Live Search has no solution (by the way: Google has no solution as well ;-)). The only thing you can do is re-run the SharePoint Products and Configuration Wizard. After that, the error disappears and the site creation process is successful.

The weird thing is, that the content type ID is the ID from the “PageLayout” Content Type... If anyone found another solution I would be very interested.

Visual Studio 2008 SP1: Endlich ohne “Build” die Fehler sehen

Es ist kaum zu glauben! Mit Visual Studio 2008 SP1 hat nun endlich die Funktion einzug gehalten, die man schon seit Jahren vermisst, wie ich gerade entdeckt habe...

Man hat z.B. folgendes geschrieben:

public bool IsFoo(object x)
{
}

Früher war es so: Den “Fehler” dass nicht alle Pfade der Methode einen Wert zurückgeben bekommt man erst, wenn man “Build” aufruft.

Jetzt neu: Der Fehler wird sofort im Error Log sichtbar! Ohne speichern, ohne Build! Danke Microsoft!

Microsoft Windows SharePoint Services 3.0 – Application Development

Nachdem ich ja seit einiger Zeit MCPD EA bin, habe ich letzte Woche eine weitere Prüfung, die 70-541 abgelegt und bin nun also: MC Technology Specialist: Microsoft Windows SharePoint Services 3.0: Application Development

MCTS SharePoint Application Development

Mein Transcript wie gehabt hier zu finden: http://www.microsoft.com/learning/mcp/transcripts

ID: 761136
Kennwort: marcowiedemeyer

MTK Logger BT747 mit Windows Vista 64bit

Wie bereits hier geschrieben habe ich nun eine Lösung für meinen GPS Logger BT747.

Da das Tool BT747 mit Vista x64 nicht klar kommt, verwende ich also nun gpsbabel um die Daten abzurufen. Es kommt ein bin file raus, was gpsbabel leider nicht in csv konvertieren kann.

Dazu habe ich nun ein eigenes Tool geschrieben, oder besser gesagt von Java in .NET übersetzt.
Hier gibts den download des Tools. Verwendet wird es so:

bt747logconverter.exe data.bin output.csv

Zuvor noch diese Zeile ausführen um das bin file vom Logger zu laden (com4 durch entsprechenden Port ersetzen):

gpsbabel.exe -p "" -w -i mtk -f com4:

Endlich eine funktionierende Lösung unter 64bit…