答案1
根据我的研究,恐怕没有内置方法可以实现这一点。如果您想要宏,建议前往 Outlook 开发者论坛获取更多信息。
答案2
我设法切换到(选择)几个常用的收藏夹文件夹。下面我展示了如何使用自动热键。请参阅下面的脚本,后面是带注释的屏幕截图。
这确实依赖于窗口坐标,而窗口坐标当然很脆弱。只有当您按顺序移动收藏夹时,这才会成为问题(在我使用的 Outlook 中并非如此)。如脚本所示,我选择使用以下键:
- u== 显示未读邮件收藏夹
- i== 显示收件箱收藏夹
请注意,这些是单键按下,而不是使用Ctrl等。
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Allow rerunning this script by double-clicking on this file in the
; Windows Explorer to Reload it, versus the cumbersome process of
; having to right mouse click on the tray icon and select Reload:
#SingleInstance Force
SetTitleMatchMode 2 ; allow partial match to window titles
; Hotkeys for Outlook
;
; Reference material used in this implementation:
; https://autohotkey.com/board/topic/38389-archiving-email-in-outlook-with-a-single-keystroke/
;
; As best I can tell, the window text 'NUIDocumentWindow' is not present
; on any other items except the main window. Also, I look for the phrase
; ' - Outlook' in the title, which will not appear in the title (unless
; a user types this string into the subject of a message or task).
#IfWinActive - Outlook ahk_class rctrl_renwnd32, NUIDocumentWindow
i::SelectFavoriteInbox()
u::SelectFavoriteUnreadMail()
#IfWinActive
SelectFavoriteInbox() {
ScopedMouseClick(48, 269)
}
SelectFavoriteUnreadMail() {
ScopedMouseClick(48, 297)
}
ScopedMouseClick(click_x, click_y) {
; Save off current mouse coordinates to restore them afterwards:
MouseGetPos, curr_x, curr_y
; Move mouse cursor:
MouseMove, %click_x%, %click_y%
; Click left mouse button:
Click, Left
; Restore mouse coordinates
MouseMove, %curr_x%, %curr_y%
}