Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2015, 11:20 PM
gmayor's Avatar
gmayor gmayor is offline VBA and Word basics help Windows 7 64bit VBA and Word basics help Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

This type of code should go into the document project and not the normal template, and that document must be saved as DOCM or DOTM.



__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #2  
Old 04-19-2015, 11:35 PM
Unk Unk is offline VBA and Word basics help Windows 7 64bit VBA and Word basics help Office 2010 64bit
Novice
VBA and Word basics help
 
Join Date: Apr 2015
Posts: 3
Unk is on a distinguished road
Default

Well that's interesting. That's how I had it originally. I saved it as a .docm, and when I opened it again, the code was gone. Which was what I was describing in the original post here. I would open the DOCM, the functionality was no longer working, and when I opened the Visual Basic Editor and looked at ThisDocument (under MyDocumentName), the code I had entered was no longer there.

Now I have it both there and in Normal, and it's still there when I open the docm again. The code is just as you show it, except now in both of these ThisDocument locations:

Code:
Normal
   Microsoft Word Objects
       ThisDocument

Project(MyDocumentName)
   Microsoft Word Objects
       ThisDocument
When it was only in the second one, that's when it was vanishing. In both cases it was a .docm, I haven't changed anything about the way I was saving it.

I'll have more time to learn about this during the coming week, but it's good to have it working anyway, and I can go from there.

Thanks.
Reply With Quote
Reply



Other Forums: Access Forums

All times are GMT -7. The time now is 01:40 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