Publish post from Microsoft Word 2007

December 15, 2008

Let’s take a look into on of the utilities\feature of Microsoft Word 2007 where you can write, edit and publish new or old posts to variety of blog service providers including wordpress and blogspot. In this post we will go step by step setting an wordpress account in my word document blog publish utility. This is actually called offline blogging or desktop blogging where you write a blog on some application offline and then publish them to web\blog service provider or providers at once whenever you want.

When you open a Word document click on File menu to find more options present there and then you can see a publish option present as shown in the image below:

blogpublish11

You can then see another document getting opened with new menu items as publish, home etc and a pop-up window for creating a new account would come. You can setup word publish to work with wordpress, blogger, community server, sharepoint blog, typepad etc. This can be seen in the image below:

blogpublish21

Once you select the blog service provider for setting an account you will proceed to the new window. I selected wordpress and then entered the blog url along with the credentials to use my wordpress account\data here in the offline mode. It works by the medium of webservices to get the data for you or load your data to your blog server provider. You can also provide your photo or imager server url to use the post images from.

blogpublish3

Now, we are ready to write a new post in our word document and publish from the same page menu. We can get our older posts, review it, edit it and then republish the same. Click on Home page in the menu shows your blog home page, you can manage different accounts and then using it can publish the same post to multiple providers.

Hope this will help to some of you!!

Happy Blogging…


Group by All – keyword in t-sql

December 8, 2008

There is a problem I came across some time back where I was having a table with names (including duplicates) in it and had to get name, count(name) as an output with a where clause to eliminate some of the entries. Major output requirement was to include the eliminated name entries too in the output and show name, 0 for those entries. Please find below the problem and solutions in detail:

Problem: There is a table having ID and Names like below and I need to return Name and Count of each Name.

Table: The table named Names looks like one provided below:

ID Name
1 Sushant
2 Pandey
3 Sushant
4 Sushant
5 Scott
6 Scott
7 Pandey

We can get the required output by using this query: Select Name, Count(Name) from Names group by Name

The output will look like:

Name Count
Sushant 3
Pandey 2
Scott 2

Now the real problem comes when we have to use a where clause which filters some entries. Clause is ‘where Name like ‘%S%’so if we use this clause in above query we would get the below result.

Name Count
Sushant 3
Scott 2

(Query: Select Name, Count(Name) from Names where Name like ‘%S%’ group by Name).

So, going by the original requirement of including entry ‘Pandey’ also into the result showing count = 0 like

Name Count
Sushant 3
Scott 2
Pandey 0

We can get this by two ways mentioned below:

  1. Solution 1: We can use union to get the above result. Though it seems to have more computation involved in it.

    select Name,count(Name) as [count] from Names where Name in (select Name from Names where Name like ‘%S%’)group by Name union select Name, 0 as [count] from Names where Name not in (select Name from Names where Name like ‘%S%’)group by Name

  2. Solution2:  There is a keyword for ‘Group By’ clause where we can use ‘All’ which make groups for all the entries even if they are filter out by a where clause. So the below query results in same output:  Select Name, Count(Name) from Names where Name like ‘%S%’ group by all Name

So, after messing a lot I found that the solution lied in just one line query so thought of posting. Might be helpful to you.

Bye for now…


Who am I what am I doing?

Who am I what am I doing?