W
Wendy D
(FYI - I posted this on the beginners, general, and userforms boards.)
I have created a template where I created a userform with 2 "fields"
(ProjectName and TaskName). Each field corresponds w/a bookmark. I'm using
REF commands to link/repeat the bookmarks in the footer of the report. It is
all working well except that the data that is input through the userform is
getting added to the (default) bookmark text instead of replacing it. I
found a MVP document that gives me a general idea of what I need to do (set a
bookmark range variable) {MVP Doc: Inserting text at a bookmark without
deleting the bookmark}. It includes a subroutine when using a
macros/userform, but I'm not sure where to put it. Can anyone help me with
this???
THANK YOU!
Wendy
Now, template bookmarks look like: [ProjectName] and [TaskName]. If I
input a 1 (for project name) and a 2 (for task name) in the userform when I
open a new document, the bookmark data changes to: [1ProjectName] and
[2TaskName]. I need it to change to [1] and [2] (but keep the bookmarks).
My VBA code has:
AUTONEW MODULE
Sub AutoNew()
'
' AutoNew Macro
' Macro created 8/16/2005 by wdaniels
'
UserForm1.Show
End Sub
USERFORM - Commandbutton1
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("ProjectName").Range _
.InsertBefore TextBox1
.Bookmarks("TaskName").Range _
.InsertBefore TextBox2
End With
UserForm1.Hide
End Sub
I have created a template where I created a userform with 2 "fields"
(ProjectName and TaskName). Each field corresponds w/a bookmark. I'm using
REF commands to link/repeat the bookmarks in the footer of the report. It is
all working well except that the data that is input through the userform is
getting added to the (default) bookmark text instead of replacing it. I
found a MVP document that gives me a general idea of what I need to do (set a
bookmark range variable) {MVP Doc: Inserting text at a bookmark without
deleting the bookmark}. It includes a subroutine when using a
macros/userform, but I'm not sure where to put it. Can anyone help me with
this???
THANK YOU!
Wendy
Now, template bookmarks look like: [ProjectName] and [TaskName]. If I
input a 1 (for project name) and a 2 (for task name) in the userform when I
open a new document, the bookmark data changes to: [1ProjectName] and
[2TaskName]. I need it to change to [1] and [2] (but keep the bookmarks).
My VBA code has:
AUTONEW MODULE
Sub AutoNew()
'
' AutoNew Macro
' Macro created 8/16/2005 by wdaniels
'
UserForm1.Show
End Sub
USERFORM - Commandbutton1
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("ProjectName").Range _
.InsertBefore TextBox1
.Bookmarks("TaskName").Range _
.InsertBefore TextBox2
End With
UserForm1.Hide
End Sub