Re: creating a userform
- From: "Jay Freedman" <jay.freedman@xxxxxxxxxxx>
- Date: Tue, 15 Nov 2005 14:25:28 -0500
You got zapped by a tiny problem that hits about half the new users who try
that code. :-( You retyped the code into the editor, instead of using
copy/paste, and you missed the fact that there's a space between the word
Range and the underscore at the end of the line. The underscore is VBA's
"continuation character" to say that the same statement continues onto the
next line -- but it *must* be separated from the preceding text by a space,
or else it won't be recognized. See
http://word.mvps.org/FAQs/MacrosVBA/_AtEndOfLine.htm for a discussion.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Jill D wrote:
> It is saying method or data member not found.
>
> "Jay Freedman" wrote:
>
>> That code looks perfectly ordinary. What's the problem?
>>
>> --
>> Regards,
>> Jay Freedman
>> Microsoft Word MVP FAQ: http://word.mvps.org
>>
>> Jill D wrote:
>>> One more problem.....I just tried to make a userform with a command
>>> button and didn't change any of the names or anything. I just wanted
>>> to try to do it plainly (if that makes any sense) and this is what I
>>> came up with.
>>>
>>> Private Sub CommandButton1_Click() -this is highlighted
>>>
>>> With ActiveDocument
>>> .Bookmarks("ClientName").Range_
>>> .InsertBefore TextBox1
>>> End With
>>>
>>> UserForm1.Hide
>>> End Sub
>>>
>>>
>>> "Jill D" wrote:
>>>
>>>> Okay, so I didn't figure it out. THis is what is happening now.
>>>>
>>>> Sub AutoNew()
>>>> '
>>>> ' AutoNew Macro
>>>> ' Macro recorded 9/1/2005 by Matthew Pearson
>>>> '
>>>> ClientName.Show
>>>> End Sub
>>>>
>>>> The ClientName.Show is highlighted saying Object Needed.
>>>>
>>>> I also had a question on one of the links you sent me. In the
>>>> create a userform link it says in step 6 to dimension the textbox.
>>>> What does that mean?
>>>>
>>>> Thanks
>>>>
>>>>
>>>> "Jill D" wrote:
>>>>
>>>>> I actually figured it out!! I put in the wrong name for the
>>>>> userform!! Thanks so much for your help!!
>>>>>
>>>>> "Jay Freedman" wrote:
>>>>>
>>>>>> Jill D wrote:
>>>>>>> I have tried to create a userform and it doesn't seem to be
>>>>>>> working properly. I keep coming up with the error "method or
>>>>>>> data member not found". Also I don't know how to change the
>>>>>>> name of the userform or the commandbutton. I'm a total beginner
>>>>>>> at this, and any help would be greatly appreciated!
>>>>>>>
>>>>>>> Thanks!
>>>>>>> Jill
>>>>>>
>>>>>> See http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm and
>>>>>> http://www.dragondrop.com/wordcoding/word011a.asp for tutorials
>>>>>> about userforms.
>>>>>>
>>>>>> The error message means you've tried to use something that
>>>>>> doesn't exist. There's no way to tell what it is without seeing
>>>>>> the code. Paste it into a reply to this post (no attachments,
>>>>>> please!) and point out which line has the highlight when the
>>>>>> error occurs.
>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>> Jay Freedman
>>>>>> Microsoft Word MVP FAQ: http://word.mvps.org
.
- References:
- Re: creating a userform
- From: Jill D
- Re: creating a userform
- Prev by Date: Re: unopenable new Word documents
- Next by Date: Re: Dates in Letters
- Previous by thread: Re: creating a userform
- Next by thread: Re: table breaking on next page
- Index(es):
Relevant Pages
|