User form

M

Mark

Thanks to some help from here, I have set up a userform letter head which
allows people to very simply open a template letterhead, insert a team name
in the header section, and adress and telphone number in the footer...all
works quite well.

One problem... protection. I guess I am missing some VBA code to maintain
the protection.

Basicall when they open the form a menu pops up, which they complete and the
info is then place in the header and the footer of the document. They then
type up the body of the letter. I have 3 bookmarks (team name in header,
adress and tel. no in footer), plus the body of the letterhead is a "comment"
field to allow the user to enter the body of his letter.

However, even thought i have password protected the .dot file, it is no
longer there when I re-open the .dot file, or when I go "open" "new"
"template"

Basically, I want the user to be able open the template and inserts his 3
pieces of info. After that he has access only to the body of the letter (and
if necessary his 3 pieces of info). I dont want him to be able to change the
base text and logo's in the header and the footer.

MVP site and Dian site helped with basic set up, but I cannot undrestand hoe
to complete protection.

Here is my VBA code:

Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("TeamCategory").Range _
.InsertBefore teamCategory
.Bookmarks("Adress").Range _
.InsertBefore adress
.Bookmarks("Telephone").Range _
.InsertBefore phoneno
End With

UserForm1.Hide

End Sub


Thanks for your help.
Mark
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?TWFyaw==?=,

You don't mention which commands you're using to activate protection. Is it
Tools/Protect, and you're protecting for a form? some thoughts...

1. I don't know what you mean by a "comment" field, either. But from the sound
of it, what you should be doing is inserting a continuous section break, then
protecing Section 1 (that will lock out the headers/footers), leaving Section 2
unprotected. This way, the user can edit the body of the letter (Section 2)
using most of the usual formatting commands.

2. The most common cause for forms protection being lost is saving the file in a
non Word-Document file format, such as RTF. Are you certain the document is
being saved AND opened as a Word document (*.doc)?

3. Which version of Word are you using?
Thanks to some help from here, I have set up a userform letter head which
allows people to very simply open a template letterhead, insert a team name
in the header section, and adress and telphone number in the footer...all
works quite well.

One problem... protection. I guess I am missing some VBA code to maintain
the protection.

Basicall when they open the form a menu pops up, which they complete and the
info is then place in the header and the footer of the document. They then
type up the body of the letter. I have 3 bookmarks (team name in header,
adress and tel. no in footer), plus the body of the letterhead is a "comment"
field to allow the user to enter the body of his letter.

However, even thought i have password protected the .dot file, it is no
longer there when I re-open the .dot file, or when I go "open" "new"
"template"

Basically, I want the user to be able open the template and inserts his 3
pieces of info. After that he has access only to the body of the letter (and
if necessary his 3 pieces of info). I dont want him to be able to change the
base text and logo's in the header and the footer.

MVP site and Dian site helped with basic set up, but I cannot undrestand hoe
to complete protection.

Here is my VBA code:

Private Sub CommandButton1_Click()
With ActiveDocument
.Bookmarks("TeamCategory").Range _
.InsertBefore teamCategory
.Bookmarks("Adress").Range _
.InsertBefore adress
.Bookmarks("Telephone").Range _
.InsertBefore phoneno
End With

UserForm1.Hide

End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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