Re: creating a userform

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


.



Relevant Pages

  • Re: Pulling out words in capitals from word doc
    ... > Set Source = ActiveDocument ... > Set Target = Documents.Add ... >>> Regards, ... >>> Jay Freedman ...
    (microsoft.public.word.vba.beginners)
  • Re: Word 2003 startup problem, runtime error dialog at startup
    ... >McAfee VirusScan & Firewall (along with a hardware firewall) and scan several ... >I've repaired, uninstalled, and reinstalled Office Pro 2003 and Win XP Pro ... Regards, ... Jay Freedman ...
    (microsoft.public.word.application.errors)
  • Re: Avian Flu, BSE and FMD
    ... >> Jill has been extremely forthright over the years. ... If you do have relatives in veterinary service, ... Regards ... > Pure bred utility chickens and ducks ...
    (uk.business.agriculture)
  • Re: Document is truncated to only one page
    ... >Close WordPad, go back to Word, and open the RTF. ... navigate to the Templates folder). ... Regards, ... Jay Freedman ...
    (microsoft.public.word.newusers)
  • Re: Mark responds
    ... Jill wrote: ... Ronald Reagan advised his sons to always say ... "I love you" to their wife at least once per day. ...
    (soc.men)