Publish to Drupal using Microsoft Word 2007

In this article I will show you how to use Microsoft Word 2007 to post to your Drupal website. The reason that I occasionally use Word to post directly to Drupal is purely as a quick way to put images into a post without having to worry about cropping, resizing or uploading using a third-party tool.


Drupal Setup

To start with, you will need to setup Drupal to allow you to post from Word.

Activate the Blog API module (Administer > Site Building > Modules > Blog API). You can find additional configuration for this in Administer > Site Configuration > Blog API.

Next set the default input format to Full HTML this can be found in Administer > Site Configuration > Input Formats. The reason we do this is so that the images are not filtered out by Drupal.


Microsoft Word Setup

Now that we've setup Drupal to accept from Microsoft Word, open up Word and click the Office Button and go to new. Select New blog post.

Next we need to tell Word how to connect to Drupal. You can do this from Manage Accounts on the ribbon bar.

When it asks you to choose a blog provider, choose Other.

On the following screen choose MetaWebLog as your API. The blog post URL is your Drupal installation folder followed by xmlrpc.php e.g. Put in your username, and password and then go into Picture Options.

From the Picture Options screen, choose My own server as the picture provider. In the Upload URL field you should put in the FTP details of your image folder. It should be in the format ftp://username:[email protected]/root/path/to/images/. The root/path/to/images is relative to the FTP root not the public area. So if you upload your website to /var/www/html/ put ftp://username:[email protected]/var/www/html/images/. Remember that you are saving your password here in plain text. You should maybe consider setting up anonymous write-only access to a folder.

In the Source URL field, put in where the world can access those photos.

If you have more than one content type (blog, story, page) you will be asked which "blog" you want to upload to. You will then be shown a confirmation message.

Publishing Content

All that is left to do is to write some content! Finish off by publishing it to your website. You should consider publishing as draft so you can check the layout on your website before it goes live.

You now have the flexibility to create posts offline, put in multiple images without uploading them separately and format the post using a familiar interface!


Danger with Full HTML as default

Making Full HTML the default input filter makes this format available to anyone with the rights to post a comment (possibly including anonymous users) and is a security hole. My recommended solution is to implement the Better Formats module to allow some roles to have Full HTML and not others.

I completely agree

I completely agree. For this example, Full HTML was chosen as it was for a simple single user site (i.e. the single user was the administrator).