OneNote 2007 NavigateTo API

B

benmca

I'm using the OneNote interop, trying to use the NavigateTo API, and I
may have found a bug: I have the following code:
_oneNoteApp.NavigateTo(ActiveNotebookId, curPageId,
true);

I am expecting a new OneNote window to pop up, showing page curPageId
within Notebook ActiveNotebookId. The actual behavior is the UI pops
up to the previously viewed notebook/page. I have verified that
ActiveNotebookId, curPageId are valid. Maybe I'm missing something
obvious here ;)

Flipping the last arg to false pops nothing up. What should the
expected behavior be if I flip the last arg to false?

Thanks in advance- Ben
 
J

Josh Einstein

Yeah you got the parameters mixed up. Pass the page id in as the first
parameter, the second parameter is the object on the page you want to scroll
to I believe (which should be null if you just want to open to a page).
Since the pages are identified with guids there is no need to specify the
notebook or section.
 
D

Daniel Escapa [MS]

*wipes brow*

Glad to see there aren't any bugs with this, thanks Josh!

There is a small annoyance that I will spill the beans on. If you don't
have OneNote UI open and you go a NavigateTo it will cause OneNote to appear
and it will bring that window to the foreground. However if you already had
a OneNote UI window present it would not bring the OneNote window to the
foreground, it would only navigate that window and the user may or may not
see it.

If you want to ensure that the user always sees the UI you should use the
Win32 call to set the active window. Of course if you have thoughts or
ideas for the future please let me know.

Also Ben please post whatever you are working on so the whole community can
see what tool you are writing; that is if it isn't some secret work project.

Take care
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top