That's really quite simple. You should spend a little time studying Word's API.