PLEASE .... help me "compile error" on a simple code

T

Tanya Myatt

Hey there, I am currently trying to implement the use of a
userform so that a clinician can "fill in the blanks" so
to speak on a userform for simple items like client name,
tests used, severity level of child's speech and langauge
development. I was thinking of doing this with bookmarks
in the template and then having the userform link the
entries to all these bookmarks so that it is a matter of
just entering and then the items get plopped where the
bookmarks are. I attempted this but I keep getting a
compile error and as I truly have no clue what I am doing
yet I was wondering if someone could direct me to "ready-
made code" or at least help me with my little code...
Anyhelp is appreciated.... The following is what I
attempted... lol....

When I run it in my template where the codes are, the
userform comes up but when I go to execute the command
button it says "Compile error: Method or data member not
found". What does this mean? What can I do to fix it??
THANKS TO ANYONE WHO CAN HELP ME...
Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("child").Range_
.InsertBefore child
.Bookmarks("refsour").Range_
.InsertBefore refsour
End With

UserForm1.Hide

End Sub
 
J

Jean-Guy Marcil

Hi Tanya,

What are child and refsour in your code? I mean where are they from? Are
they variables? Are they from text boxes?
(I do not mean the one between quotes, those I gather are your bookmark
names....

BTW, FWIW, it is better to try to use meaningful names... Here you have two
things called child, a bookmark name and another one I do not know... With
more involved code, if you start naming everything related to one item by
the same name, you quickly go mad trying to figure it out when something
goes wrong!
--
Cheers!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top