Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2022, 09:18 PM
gmayor's Avatar
gmayor gmayor is offline Drawing Button With VBA To Rename File And Save Windows 10 Drawing Button With VBA To Rename File And Save Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
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


No that's not what I meant. See Installing Macros


With the document open, the code should be in a new module of the document project. If the button is on the QAT (Quick Access Toolbar) then you will have to delete that button and create a new one.

To create a template simply save the document as a macro enabled template. This will not overwrite your document, but create a new template from that document.
__________________
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 10-26-2022, 12:56 AM
data808 data808 is offline Drawing Button With VBA To Rename File And Save Windows 10 Drawing Button With VBA To Rename File And Save Office 2019
Novice
Drawing Button With VBA To Rename File And Save
 
Join Date: Oct 2022
Posts: 16
data808 is on a distinguished road
Default

Ok I moved the VBA code from Normal / Modules to Project / Modules so I think now the VBA is switched to only this document. I then removed the button from the QAT and created a new one and set it for just this document that I am working on and it now seems to show up for only this document.

Now I'm going to start testing the code and get back to you on what results I get. Thanks for your help.
Reply With Quote
  #3  
Old 10-26-2022, 01:23 AM
data808 data808 is offline Drawing Button With VBA To Rename File And Save Windows 10 Drawing Button With VBA To Rename File And Save Office 2019
Novice
Drawing Button With VBA To Rename File And Save
 
Join Date: Oct 2022
Posts: 16
data808 is on a distinguished road
Default

Ok I just tested it and nothing happens. Not even your line:

If aCC.ShowingPlaceholderText = True Then
MsgBox "Complete the 'Subject' field!", vbCritical

I assume this is a prompt for the user to fill in the subject field if it's blank? I tested it by leaving the field blank and clicking the macro button in the QAT and nothing happens. No prompt or saving of the file to the desktop. Do I need to change the sPath? It looked like you may have set it to a universal username/desktop so I just left the line of code as is. In fact, I left your entire code as is. So let me know if I was supposed to change anything.

If not, one other thing I can think of that may be causing this problem is that the Subject title was not entered by me typing it into the properties but rather me doing an Insert / Quick Parts / Document Properties / Subject selection from a drop down list because I had another text box later in the document that I wanted to repeat whatever I typed in that first subject field. So maybe because of that, the code you provided doesn't register that text box as an official "Subject" titled text box?
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to save Word file by field name as filename using VBA button? TribeBuckeyeFan Word VBA 4 02-02-2017 05:58 AM
Drawing Button With VBA To Rename File And Save How to save Word file by field name as filename using VBA button? chemtoli Word VBA 5 01-25-2017 08:06 AM
Save and rename attachments from ZIP FILE AndyDDUK Outlook 1 03-03-2016 12:32 AM
Drawing Button With VBA To Rename File And Save Have to rename file every time to save workbook intelli Excel 3 03-27-2014 11:53 PM
Drawing Button With VBA To Rename File And Save Rename Document & Save d4okeefe Word VBA 4 05-23-2013 09:35 AM

Other Forums: Access Forums

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