Please help

C

CStanley

Maybe I am asking for too much help, but if anyone has any
ideas that might help me solve the problem I wrote about a
few days ago, I would so much appreciate it. Please see
the message entitled Re: Creating

Thank you
 
S

Steve Smallman

Christine,

Firstly, the Private Sub LabelX_Click() do nothing, and can be deleted. You
have opened the code window for these labels (presumably on your form) and
these lines have been generated by the VBA editor.

Your current problem is not clear. I think you have:

Created a form letter
Created bookmarks within that letter
Created a user form with text boxes that contain the information you
want put into the form letter
Set the form to pop up on the document opening
Included a command button on the form to transfer the information to the
document.
Set the command button to transcribe the contents of the text boxes to
the various bookmarks in your document.
Close the user form

Does the code run, or does it stop and if so at what point. Have you set
break points in your code to review the contents of the text boxes and
ensure they contain information. Probably more importantly have you tried to
see what the "ActiveDocument" is?

Steve
 
C

CStanley

Steve,

You've summarised in a nutshell exactly what I'm trying to
do. Thank you so much for your reply. I found the
problem, and it was such a simple mistake - I had missed
out a bookmark from my template (!) and now this has been
added in, the form runs just fine.

I'm a complete beginner at this, and had created the user
form by copying the instructions from
http://www.mvps.org/word/FAQs/Userforms/CreateAUserForm.htm
This didn't say anything about setting break points, and I
can't see anything about them in the book I got from the
library yesterday. Do you know where I can find out more
about these?

I'm not sure I would want to include them however, because
the nurses may not need to fill out every text box in the
form, and I don't want to make it awkward for them to use
if (for example) they don't know a patient's postal code.
What I've done is insert a label above the command button
reminding them to ensure the information they've entered
is correct before pressing the OK button. For future
reference though, I'd like to find out more if you have
any pointers on where to look.

Thanks again.

Christine
 
W

Word Heretic

G'day "CStanley" <[email protected]>,

Break points are set manually by session. You select to the left of
the line of code and it sets a mark that looks like the recorder's
circle. There's also a menu option off tools to set one as well, on
the selected line of code.

More advanced techniques also call for the debug statement and
watching variables.

The concept being that when that code runs it 'breaks' at a convenient
point for you to suss out the internals. If its not a convenient
point, you aren't using your debug tools effectively.



Steve,

You've summarised in a nutshell exactly what I'm trying to
do. Thank you so much for your reply. I found the
problem, and it was such a simple mistake - I had missed
out a bookmark from my template (!) and now this has been
added in, the form runs just fine.

I'm a complete beginner at this, and had created the user
form by copying the instructions from
http://www.mvps.org/word/FAQs/Userforms/CreateAUserForm.htm
This didn't say anything about setting break points, and I
can't see anything about them in the book I got from the
library yesterday. Do you know where I can find out more
about these?

I'm not sure I would want to include them however, because
the nurses may not need to fill out every text box in the
form, and I don't want to make it awkward for them to use
if (for example) they don't know a patient's postal code.
What I've done is insert a label above the command button
reminding them to ensure the information they've entered
is correct before pressing the OK button. For future
reference though, I'd like to find out more if you have
any pointers on where to look.

Thanks again.

Christine

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email (e-mail address removed)
Products http://www.geocities.com/word_heretic/products.html

Replies offlist may require payment.
 
C

CStanley

I found a page at the Office '97 website that deals with
the subject (the one Feagin recommended in another
thread), but your reply has put something in perspective
for me. Thanks for the reply :)

Christine
 

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