4

我只需要知道一旦打开“新消息”表单的主题字段如何设置焦点..这可以实现吗?!

非常感谢您的帮助。

4

2 回答 2

0
  • The Outlook API exposes methods for retrieving the current inspector, explorer or either or. I believe you'll get back a number (HWND) which is a window handle.

  • You can then use the Win32 API to find that window, and then find a child window

  • Use Spy++ from Visual Studio Tools menu, and you will find the subject field doesn't have a unique caption. You'll have to find the label which has a caption of "S&ubject", and the next Window in the list should be the RichEdit20WPT subject textbox.
  • Finally, use the appropriate Win32 function to focus the field.

You'll need to [DllImport] the user32.dll

I leave it up to you to implement, and if you need help there are plenty of examples out there on how do use the win32 api to perform the tasks outlined above.

于 2018-02-05T06:54:52.153 回答
0

宣布:

private Microsoft.Vbe.Interop.Forms.Control txtToCtrl;

初始化:

this.txtToCtrl = (Microsoft.Vbe.Interop.Forms.Control)GetFormRegionControl("_RecipientControl1");

准备就绪时:

this.txtToCtrl.SetFocus();
于 2020-10-13T18:56:47.910 回答