Word macros: is there an event that's fired when content (macros) is enabled? - vba

When I open Word documents that contain macros, Word's default behavior is to post a Security Warning and present a button with the caption "Enable Contents."
My question is whether is a way to be notified (e.g. via an event) when the user clicks this Enable Content button.
I couldn't find anything like it in the Word DOM reference.

There's no event that's fired off. You could have a thread that monitors the screen for that button and click it with API. You could enable all macros so it doesn't appear. See this article: http://office.microsoft.com/en-us/word-help/enable-or-disable-macros-in-office-files-HA010354316.aspx

Related

How can I remove keyboard focus from a button on User Control after clicking it, in a vb.net PowerPoint add-in?

I have a vsto add-in for PowerPoint (vb.net) which includes a User Control with several buttons.
After clicking any of those buttons, or the User Control itself, I can't immediately use 'Ctrl' keyboard shortcuts, like Ctrl+C. It seems that the button or the User Control gets the focus. If I click on the slide, 'Ctrl' keyboard shortcuts work again.
Is there a way that I can take the focus away from the Button / User Control, in my Button1.Click event handler, in order to be able to use Ctrl+C right away? Or a way in which I can place the focus on the PPT Presentation?
I have searched and tried a ton of different methods, with no success...
PS: One observation I have made is that if instead of a Button, I click a Panel within my User Control, I do not have this problem.
Another observation is that while I can't use 'Ctrl' shortcuts right after clicking the button, 'Alt' shortcuts continue working fine.

Outlook Web Add-in: Can we add an entry into context menu?

I didn't find this functionality in Outlook web add-in documentation. But it's worth to ask...
We want to add a new entry into Outlook right click menu (context menu), so that it can open a hyperlink (url is different based on what you highlighted) to integrate with our web portal.
I understand contextual outlook add-in is the closer solution.
But it's not the user experience we want.
Instead of highlight everything based on RegEx, we would like to support users to intentionally trigger the add-in by highlighted keyword and right click on the context menu.
Wondering if it's possible today for the latest Outlook desktop app.
User scenario:
User highlights a keyword in email reading/writing mode
User right click the mouse
The context menu shows up with having our custom menu item
When user clicks on our custom menu item, it opens a browser with an url based on what user highlighted.
Outlook context menu cannot be extended at the moment. Available extension points are:
MessageReadCommandSurface
MessageComposeCommandSurface
AppointmentOrganizerCommandSurface
AppointmentAttendeeCommandSurface
Module (Can only be used in the DesktopFormFactor.)
MobileMessageReadCommandSurface
Events
DetectedEntity
You probably should add your business case into Office development user voice request: Outlook Web Add-in: Add Context Menu Mail Item Extension Point or at least upvote it.

OneNote 2016: How to: selected text in a page & subscribe to the onClick event

I want to implement a COM OneNote Add-In (for OneNote Desktop) with the following functionality:
User selects some text and then clicks the FORMAT button exposed by the add-in: the add-in will format the selected text in some specific way (e.g. surround the text with "<<>>" and change its background and foreground color.
Later on when the user clicks on a text that was formatted as described above the add-in kicks in and copies the text in clipboard
I am new to COM add-ins, and I wasn't able to find a good API documentation. I've started with VanillaAddIn (https://github.com/OneNoteDev/VanillaAddIn) and now I need to add my functionality. I would really appreciate any help with the following:
How to get the selected text from a page?
How to subscribe to the OnClick event?
Is there a good/decent OneNote API documentation? I found some links but I still hope there is a better one that I missed so far.
To get selected text from a page, look at the GetPageContent API. You can see it used here: https://github.com/OneNoteDev/VanillaAddIn/blob/master/VanillaConsole/Program.cs
From the page content xml, you can find some elements that are "selected".
OnClick event: There's no way to know when someone clicks on some text on the page, unfortunately.
One site that can help with parsing the page content is the OneNote XSD. Here: https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/63/17/0336.OneNoteApplication_2013_xsd.txt

Events not triggering when using Send To (Mail Recipient)

I have an Outlook VBA form, which (on the initialize event) loads various data into menus.
This works in normal usage, however, if you right click, send to (mail recipient) on a file or Send > Email in Word, when you click the button to load the form, the form displays but nothing in any events trigger either on the form load, or on the various click events.
Can anyone offer an explanation of why and how to work around the issue?
You need to handle the NewInspector event of the Inspectors class.
Outlook inspectors shown using Simple MAPI or mailto link do not fire inspector events. This was done on purpose.
Which particular event are you using?

how to add linklable after some text in richtexbox

I am a .net developer . I am building a desktop application. how to add LinkLabel after some text in richtexbox ?
i have used .past method for insert text.
By default it should detect links in the control itself. If not you may have changed that sometime.
Go to properties of the control and look for DetectUrls make sure that is set to True. This should detect links in the control.
To handle the links when clicking them you can create an event handler for the LinkClicked event to handle all links clicked in the control. The LinkClickedEventArgs that is provided to the event handler for the LinkClicked event provides data that enables you to determine which link was clicked in the control in order to process the link.
You can read more here: https://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.detecturls(v=vs.110).aspx