Outlook 添加、文本框、删除\退格键不起作用
我开发了一个 Outlook 插件(自定义任务窗格),并在用户控件中使用 Web 浏览器。
当我在网络浏览器的文本框中写入内容时,退格键或删除按钮旁边的所有功能都运行良好,但我无法使用这些键,我是否遗漏了某些内容?
I developed an outlook add in (custom task pane), with web browser in the user control.
All the things working well beside the backspace or the delete button when I am writing something in text box in the web browser, I can't use those keys, am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我迟到了几年,但我设法解决了这个问题。解决此问题的最简单方法是确保输入字段获得适当的焦点,因此您需要能够在加载的任何页面上运行自己的 javascript。
我在页面上运行的 javascript 如下(使用 jQuery):
window.external 变量包含从插件(我假设是 c# 或 VB)运行的代码,该代码是公开的,因此我们可以从网页交互回加载项。
在自定义任务窗格的加载项代码中设置 window.external 的上下文:
以及用于聚焦的公共方法:
这对我有用,我希望它对其他人有帮助。尽管请注意,如果用户键盘使用选项卡进行导航,这可能不起作用,但您可以针对该用例扩展此代码,或者安全地假设普通 Outlook 用户将手粘在鼠标上。
I am a few years late to the party but I managed to fix this. The easiest way to fix this is to ensure proper focus is given to the input fields, so you will need to be able to run your own javascript on whatever page is being loaded.
The javascript I run on the page is as follows (using jQuery):
the window.external variable contains code run from the plugin (c# or VB I assume) which is exposed so we can interact from web page back to the add-in.
In the add-in code for the custom taskpane set the context of window.external:
And a public method for focusing:
This worked for me, and I hope it helps others. Although do note that this probably doesn't work if the user keyboard navigates using tab, but you can either extend this code for that use case, or safely assume that the average outlook user will have his hand glued to the mouse.
好的,我解决了问题,
问题是自定义任务窗格并不总是从 Outlook 获取 fucos。
因此,每次所有窗格都有“onclick”时,我都会引发一个事件,然后强制该窗格成为焦点。
Ok I solved the problem ,
The problem is that the custom task pane in not always gets fucos from the outlook.
So, I raised an event every time that there is "onclick" for all the pane, and then forced the pane to be in focus.
花了很多时间试图让它在 Outlook v16.0.13801.20288 中工作,上述内容对我不起作用。我最终得到了这个工作代码。
创建一个用户控件并向其中添加您的网络浏览器控件,然后自定义 .cs,如下所示
spent a lot of time trying to get this working in Outlook v16.0.13801.20288 the above did not work for me. I ended up with this working code.
Create a user control and add your webbrowser control to it then customize the .cs as below
事实证明这是一个很容易解决的问题。
只需编写
然后使用 MyBrowser 而不是 .NET 。
Turns out this is an easy issue to fix.
Just write
Then use MyBrowser instead of the .NET one.