Re: Problem with UserForm in Template
- From: "Greg Maxey" <gmaxey@xxxxxxxx>
- Date: 15 Nov 2006 08:50:39 -0800
Martyn,
I hate to say that the obvious problem is that you didn't do a very
good job of following the instructions.
Your:
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks ("Text1")
.InsertBefore TextBox1
.Bookmarks ("Text2")
.InsertBefore TextBox2
End With
Is missing the essential ".Range" method and the line continuation
characters "_" that are shown in the example.
See:
http://word.mvps.org/FAQs/MacrosVBA/_AtEndOfLine.htm
and "Writing Visual Basic Statements" In VBA Help.
WembleyBear wrote:
I have created a template based on the suggestion at
http://www.word.mvps.org/FAQs/Userforms/CreateAUserForm.htm
It all goes to plan except when it is executing the code for the button to
update the bookmarks on the template. My bookmarks are named as shown in the
example but the VB debugger gives an error on .Bookmarks of 'invalid use of
property'
Code is as follows:
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks ("Text1")
.InsertBefore TextBox1
.Bookmarks ("Text2")
.InsertBefore TextBox2
End With
Any suggestions would be appreciated, in fairly newbie language please.
Martyn
Word 2000
Windows 2003 over Citrix XPe
.
- Prev by Date: Re: Problem with UserForm in Template
- Next by Date: Re: Problem with UserForm in Template
- Previous by thread: Re: Problem with UserForm in Template
- Next by thread: Re: Problem with UserForm in Template
- Index(es):
Relevant Pages
|