Creating a TOC requires layout engine in order to determine page numbers, but SDK does not perform such layout functionality. There is a workaround here to let Word update the TOC for you. For more detailed information, please refer to: forum discussion thread.