Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-10-2024, 02:09 PM
MartinGM MartinGM is offline Detecting which document has been opened ? Windows 11 Detecting which document has been opened ? Office 2021
Competent Performer
Detecting which document has been opened ?
 
Join Date: May 2023
Location: England
Posts: 101
MartinGM is on a distinguished road
Default Detecting which document has been opened ?

When a specific document is opened in Word, I want to open a particular Ribbon Tab Group.



I know how to do the second bit - make the Ribbon visible and open the required Tab Group - but how do I detect that the specific doument has been opened ? Is there an evet I can use, and where do I put the code ?
Reply With Quote
  #2  
Old 07-10-2024, 02:31 PM
MartinGM MartinGM is offline Detecting which document has been opened ? Windows 11 Detecting which document has been opened ? Office 2021
Competent Performer
Detecting which document has been opened ?
 
Join Date: May 2023
Location: England
Posts: 101
MartinGM is on a distinguished road
Default

PS I don't want to make the document itself Macro-enabled, I want the Word environment to detect that it has been opened, if you see what I mean ?
Reply With Quote
  #3  
Old 07-10-2024, 03:30 PM
Guessed's Avatar
Guessed Guessed is offline Detecting which document has been opened ? Windows 10 Detecting which document has been opened ? Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,158
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You can create a macro to run when every document is opened (see How to automatically execute a Word macro when you create, open, or close a document | TechRepublic

If you want the macro to only change the ribbon if one particular docx file is opened then you have two choices on how you might implement it:
1. Put the macro into a dotm template and attach that template to the docx
2. Code the macro to check the filename/path and only do anything if it matches your condition.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #4  
Old 07-10-2024, 03:34 PM
MartinGM MartinGM is offline Detecting which document has been opened ? Windows 11 Detecting which document has been opened ? Office 2021
Competent Performer
Detecting which document has been opened ?
 
Join Date: May 2023
Location: England
Posts: 101
MartinGM is on a distinguished road
Default

Thank you - I will work on that 😀
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add text to beginning of new document opened from original Word document, with styles ctviggen Word VBA 4 02-04-2024 08:31 AM
Detecting that previous character doesn't exist (i.e., present character is first in document) Robert K S Word VBA 15 08-01-2016 09:33 AM
Document saved but cannot be opened. N. Merrett Word 0 01-13-2016 05:41 PM
Cannot select my custom tab when new document is opened seamus59 Word VBA 0 03-19-2014 12:21 PM
Detecting Who Opened in Email In Shared Folder jerem Outlook 0 03-20-2010 10:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:27 AM.


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