Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-24-2017, 09:04 AM
Loss1003 Loss1003 is offline Saveas by Bookmark Name Windows Vista Saveas by Bookmark Name Office 2013
Novice
Saveas by Bookmark Name
 
Join Date: Apr 2015
Posts: 3
Loss1003 is on a distinguished road
Default Saveas by Bookmark Name

Trying to create a macro to save document to my documents folder using the following bookmark name ("ActName"). however, it saves the file with wording "FORMTEXT" and then the bookmark name



FORMTEXT ABC Account.docm

I would like it to save this way: ABC Account.docm.

Currently using the following code:

Private Sub CommandButton11_Click()
ActiveDocument.SaveAs FileName:=ActiveDocument.Bookmarks("ActName").Rang e.Text

End Sub

Thank you,
Attached Files
File Type: docm FORMTEXT ABC Company.docm (85.7 KB, 11 views)
Reply With Quote
  #2  
Old 08-24-2017, 08:44 PM
gmayor's Avatar
gmayor gmayor is offline Saveas by Bookmark Name Windows 10 Saveas by Bookmark Name Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
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

As the bookmark is from a form field, the error relates to the fact that the field construction is toggled. It would be preferable to leave the field locked and use

Code:
ActiveDocument.SaveAs FileName:=ActiveDocument.FormFields("ActName").Result
Personally I would give thought to changing the form fields to content controls as processing such a form is much faster with content controls, especially in Word 2010. You can convert them with http://www.gmayor.com/ExtractDataFromForms.htm
__________________
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
  #3  
Old 08-25-2017, 01:41 PM
Loss1003 Loss1003 is offline Saveas by Bookmark Name Windows Vista Saveas by Bookmark Name Office 2013
Novice
Saveas by Bookmark Name
 
Join Date: Apr 2015
Posts: 3
Loss1003 is on a distinguished road
Thumbs up

Thanks, I'll give that a go as well.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Saveas by Bookmark Name SaveAs problem SixSigmaGuy Word VBA 5 05-03-2016 10:49 AM
Find Bookmark, move to bookmark, execute code, repeat raymm3852 Word VBA 10 04-15-2016 06:21 PM
Saveas by Bookmark Name SaveAs FileFormat ch1325 Excel Programming 8 04-11-2016 04:24 PM
Saveas by Bookmark Name VBS saveas API behaviour is different from Menu saveas Ahmed AbuZekry Word VBA 2 03-23-2015 02:14 AM
Saveas by Bookmark Name saveAs ChDir _ tinfanide Excel Programming 4 11-05-2011 01:40 AM

Other Forums: Access Forums

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