![]() |
#2
|
||||
|
||||
![]()
When you say you want those in the Save Box, do you want the static text of "PTLN, PTFN' or do you want the values entered into the userform text boxes?
If you want to pre-populate the default filename when you press F12, you should write that value to the document's Title property. eg ActiveDocument.BuiltInDocumentProperties(wdPropert yTitle) = "This is a default filename" In terms of errors on the second code, check your bookmarks actually exist. When your CommandButton1 code runs, it finds the bookmarks and writes text there but there is an insidious bug that removes the bookmark as part of that writing. So you need to reinstate the bookmark after setting the text value if you are going to need the bookmark in the document afterwards. Code:
Dim PTFN As Range Set PTFN = ActiveDocument.Bookmarks("PTFN").Range PTFN.Text = Me.TextBox1.Value ActiveDocument.Bookmarks.Add Name:="PTFN", Range:=PTFN I note also that your SaveForm code is not a replacement for the action of pressing F12 unless you have set that as a shortcut key.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
filename field not displaying correct filename when that name starts with # | plrsmith | Word | 1 | 07-06-2018 03:10 AM |
![]() |
UnlimitedPower | Word VBA | 1 | 08-19-2016 12:22 AM |
Userform calls other userform, then populate worksheet | Lehoi | Excel Programming | 0 | 02-03-2016 02:58 PM |
VBA Code in a UserForm module to delete a Command Button which opens the userform | Simoninparis | Word VBA | 2 | 09-21-2014 03:50 AM |
![]() |
BoringDavid | Word VBA | 5 | 05-09-2014 09:08 AM |