OneNote:将屏幕/光标移动到笔记本

时间:2017-02-03 20:49:09

标签: vba onenote

我有一系列OneNote 2010笔记本,每个笔记本包含许多部分和部分组的数百页,用作课程参与者工作簿。编辑页面的内容将离开显示(光标/屏幕/插入点;不确切地确定如何定义它),以最后一次编辑为中心。

(这类似于Excel在重新打开电子表格时记住光标位置,而Word,PowerPoint,其他人总是在最顶层打开您的文档。)

当参与者或辅导员打开笔记本时,每个页面都会随机显示,因为OneNote会在最后一个编辑位置打开它。这应该看起来干净,专业,有条理。

如何在OneNote笔记本中迭代每个页面,无论组织结构如何,并且相当于CTRL-HOME CTRL-HOME? (第二个是祝你好运。: - )

(奇怪的是,似乎没有其他人问过这个问题。我找不到任何UI方法来实现这一点。可能有一种手动编辑XML的方式,但这超出了我的范围。我很熟悉使用VBA,但依赖于IDE的关键字和语法,并且不了解OneNote对象模型。所以请充分考虑我的脚本小子。)

谢谢!

1 个答案:

答案 0 :(得分:0)

不知道4个月是否算作一个老问题,但Autohotkey应该能够做到,如果不是全部,那么大部分都是如此。我可以想到一种简单的方法,如果这些部分具有相似数量的页面,这将最有效。在一个新的.ahk脚本中:

; 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

此脚本可能不会自动通过笔记本,因为onenote 阻止外部上/下命令。不过应该没问题。我还没有测试过。