Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a search screen with a radio button control with a few choices and a Word help document with help for each of those choices but only one help icon on the screen.

So, when the user selects one of these choices and then clicks the help icon, a word help document opens but they have to scroll through the document until they get to the section that applies to their choice.

The question is; based on the radio button selected, can I open the help document to the specific section that covers that choice?

Regards,
Red.

UPDATE:
If anyone is interested;
I did find something that I think could be a starting point to achieve what I originally posted at this link:

http://www.vb-helper.com/howto_net_open_word_bookmark.html

Red.

What I have tried:

Word offers the ability to insert bookmarks at specific locations in a document but I cannot figure out how to use that to my advantage, or if it's even possible.

Internet searching so far has not given worthy results but I'm still looking.
Posted
Updated 17-Apr-17 5:22am
v2
Comments
ZurdoDev 11-Apr-17 11:56am    
As far as I know, there still is no way to do this without using Macros. The answer for years has been to save it as a webpage. I think that is still the answer.
Redvan 11-Apr-17 11:57am    
That's what I thought and heard but wanted to be sure.
Thank youi RyanDev.

1 solution

You need to add the bookmarks to the word doc directly to be able to search and find the section.

Some sample code to find and scroll to the bookmark in c#, if need VBA you'll have to port.

C#
Microsoft.Office.Interop.Word.Application wApp = new Microsoft.Office.Interop.Word.Application();

wApp.Visible = true;
Microsoft.Office.Interop.Word._Document doc = wApp.Documents.Open("yourhelpdocpath");

if (null != doc) {
    if (doc.Bookmarks.Exists("yourRadioButtonBookmarkSelection")){
         Microsoft.Office.Interop.Word.Bookmark mark = doc.Bookmarks["yourRadioButtonBookmarkSelection"];
         Microsoft.Office.Interop.Word.Range rng = mark.Range;
         wApp.ActiveWindow.ScrollIntoView(rng);
    }
}


Tested using local word document, though I believe it should work through server call long as you can definitely get the document.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900