Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-16-2021, 10:01 AM
daneyuleb daneyuleb is offline Run Code when document is Activated? Or clicked anywhere in it? Windows 10 Run Code when document is Activated? Or clicked anywhere in it? Office 2016
Novice
Run Code when document is Activated? Or clicked anywhere in it?
 
Join Date: Dec 2021
Posts: 3
daneyuleb is on a distinguished road
Default Run Code when document is Activated? Or clicked anywhere in it?

Is there a way to have a word document run a vba function whenever it's activated--and by activated, I mean--the document is already open, but the user has switched to another application then switched back to the document.



Alternatively, any method to run the vba code when, in switching back to word, the document is clicked on (anywhere in the document--not a specific button or text)?

The usage case here is -- user has opened word doc, switched to another application and possibly put some text from it in the Windows clipboard. As soon as they switch back to word (and the already open doc) I have code that will check the clipboard for specific strings and do some stuff if it sees those strings. The user could be anywhere in the document and this needs to be transparent to the user and require no extra clicks--meaning they won't be able to go find a macro button and then click it to activate this clipboard check.

I know I could run it on open, but is there any way to do it on "activate" like Excel has when a sheet is made active?
Reply With Quote
 

Tags
activate



Similar Threads
Thread Thread Starter Forum Replies Last Post
This copy of MS Office not activated chzuck Office 1 10-10-2021 03:10 PM
I clicked "this document" in VBA thinking it was a menu button, it said "saving", how can I reverse messgchr Word VBA 2 07-20-2020 06:52 PM
Is my Office 'activated' or not? mabel Office 6 08-01-2019 04:18 AM
Run Code when document is Activated? Or clicked anywhere in it? Retrieve the last activated document name. eduzs Word VBA 1 08-22-2017 03:11 PM
Hyperlink not activated by footpedal Donone PowerPoint 2 05-05-2014 04:42 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft