Simon Fell > Its just code > Word Blogger
Wednesday, May 15, 2002
A while back I posted details of how to use PocketSOAP with Word to post new blog entries to Radio.
Here's a new version of that code that now uses PocketXML-RPC this brings a number of advantages
- Works with other tools besides Radio, the XML-RPC version of the BloggerAPI is implemented by numerous blogging tools.
- The XML-RPC version of the BloggerAPI can be enabled from the prefs page in Radio, no need to run the script that enables the SOAP version.
In additon it also handles paragraphs better, based on a suggestion from Omar Shahine [who by the way did a Mac port of the SOAP version]
First off, make sure you've got PocketXML-RPC installed, and for the Radio folks goto the prefs page and make sure that XML-RPC & SOAP are enabled, and that the Blogger API is enabled. Now you can make XML-RPC calls to manage your blog.
The code is just a few simple Word macros that use PocketXML-RPC to make the XML-RPC calls to the BloggerAPI. Download this VBA module. Now fire up Word and select Tools -> Macro -> Visual Basic Editor. Now import the module into your document, or if you want the macro's always available, import them into your template (expand the tree Normal -> Microsoft Word Objects and right click and select Import File).
Look at the top of the code, there are some settings you'll need to tweak. First you'll need to enter your username & password, these are configured in the Remote Access & Security prefs page. If you want to use Word on a different machine to the machine running Radio, you'll need to tweak the RADIO_URL setting. Finally if you need to connect via a HTTP proxy, you can alter the PROXY_SERVER and PROXY_PORT settings.
Now switch back to the main word document window, enter your post and hit Tools -> Macro -> Macros -> select PostNewBlogEntry and hit run. This will send the document as a new post to Radio. Now change the entry and run the UpdateBlogEntry macro, this will prompt you for a postID which will default to the just created post. This will now post the revised text as an edit to the original post. Hey presto you're blogging from Word!
The post takes some simple HTML formatting from the document, link, italics & bold are all carried over.
You can use the Tools -> Customize options to assign the macro's to buttons on the toolbar and/or keyboard shortcuts.