How do I use the Microsoft Word API and Bookmarks feature to programmatically open a Word document to a specific location?
问题 I'm trying the following code in a Windows Form application. I'm not sure what I'm doing wrong (and I could easily be doing it wrong because I don't have a lot of experience with the Word API) but the GoTo command just cannot find the bookmark. I always get a COMException on the last line, "This bookmark does not exist." But the wordDoc.Bookmarks.get_Item(ref name) method does find the bookmark! What gives? Object fileName = System.Windows.Forms.Application.StartupPath + "\\Bookmarks.docx";