0
votes

I have a series of OneNote 2010 notebooks, each with hundreds of pages across many sections and section groups, used as class participant workbooks. Editing a page's content leaves the display (cursor/screen/insertion point; not precisely sure how to define it) centered on the last edit.

(This is similar to Excel remembering your cursor location on reopening a spreadsheet, whereas Word, PowerPoint, others always open your document at the very top.)

When participants or facilitators open their notebooks, each page feels randomly displayed, since OneNote opens it at the last edit location. This should appear clean, professional, and organized.

How can I iterate through each and every page in a OneNote notebook, regardless of the organizational structure, and do the equivalent of CTRL-HOME CTRL-HOME? (The second one's for good luck. :-)

(Strangely, no one else seems to have asked this question. I can't find any UI way to do this. There may be a manual-edit-of-XML way, but that's beyond me. I'm familiar with VBA, but depend on the IDE for keywords and syntax, and don't understand the OneNote object model. So please consider me a script kiddie at best.)

Thanks!

1

1 Answers

0
votes

Don't know if 4 months counts as an old question, but Autohotkey should be able to do, if not all, then much of this. I can think of one simple way, which would work best if the sections have similar numbers of pages. In a new .ahk script:

; This script assumes you are starting at the first notebook you want to
; change, and the first loop is the number of notebooks to change
; (the notebooks are all in order)

; related to ahk internals.
#sendmode, input
; Trigger the script with ctrl + winkey + t
^#t::
    ; Loop enough times for each notebook
    loop, 10
    {
        ; loop enough times to get through all the sections in the book
        loop, 20
        {
            send !{home} ; alt home, go to first page in section.
            ; internal loop, enough times to get through all the pages 
            ; in the biggest section
            loop, 50
            {
                send ^{home} ; ctrl home. Cursor to start of page
                send ^{pgdn} ; ctrl pgdown. Next page.
            }
            send ^{tab} ; ctrl tab. Next section.
        }
        ;Shortcuts to open next notebook
        send ^G
        send {down}
        send {return}
    }
return

This script might not automatically go through notebooks, because onenote blocks external up/down commands. It should be fine otherwise though. I haven't tested it.