Templates

A

ANJANA

I have created a template where user will open the new
document and will fill the details and update all the
fields. But, the problem I have is in these templates some
of the text is optional where user has to make choice
between two paragrahs and thereès no way I can cut the
text. So, when user will fill the fields and when he comes
to that paragraphs where he has to choose one how is he
going to choose as all the fields are protected or if he
fills all the details and the again from the beginning he
checks and delete unwanted text - this doesnèt make any
sense to me. Any suggestion appretiated.

Please help.

ANJANA
 
C

Charles Kenyon

You are talking about (I think) what Word calls an online form. You can
create an on-exit macro for checkbox fields that hides or displays given
text in response to whether or not the box is checked. (The macros unlock
the form, insert or delete the text, relock the form and go to the next
formfield.)

The following macro inserts some text and removes strikethrough formatting
for other text in a form. I wrote it a while back but it could give you a
start.

Sub DucesTecum()
'
' DucesTecum Macro
' OnExit macro for DucesTecum Checkbox
' "&chr(10)&"Macro recorded 05/16/2001 by Charles Kyle Kenyon
'
Dim strBringWith As String, rRange As Range
With ActiveDocument
UnProtectSubpoena 'subroutine below
Set rRange = .Bookmarks("YouBringYes").Range
'Save result of form field
strBringWith = .FormFields("BringWhat").Result
If .FormFields("chkDucesTecum").CheckBox.Value _
= True Then
.FormFields("DucesTecumTitle").TextInput.EditType _
Type:=wdRegularText, Default:=" Duces Tecum "
If strBringWith = "" Then strBringWith = _
"Bring what?" 'End If
.FormFields("BringWhat").TextInput.EditType _
Type:=wdRegularText, Default:=strBringWith, _
Enabled:=True
rRange.Font.DoubleStrikeThrough = False
rRange.Font.Bold = True
.FormFields("BringWhat").Select
Else
.FormFields("DucesTecumTitle").TextInput.EditType _
Type:=wdRegularText, Default:=" ", Enabled:=False
.FormFields("BringWhat").TextInput.EditType _
Type:=wdRegularText, Default:="", Enabled:=False
rRange.Font.DoubleStrikeThrough = True
rRange.Font.Bold = False
.FormFields("chkThirdParty").Select
End If
.Protect wdAllowOnlyFormFields, True, sPass
End With
End Sub

Private Sub UnProtectSubpoena() 'Subroutine for other procedures
With ActiveDocument
sPass = .Variables("FormPassWord")
If .ProtectionType <> wdNoProtection Then .Unprotect (sPass)
' End If
End With
End Sub

In this, the text is inserted in a formfield which is otherwise blank and
disabled. The form is protected for forms and the password is stored as a
document variable.

If you send me an email, I'll send you the form.
--

Charles Kenyon

Word New User FAQ & Web Directory:
<URL: http://addbalance.com/word/index.htm>

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide)
<URL: http://addbalance.com/usersguide/index.htm>

See also the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

I have created a template where user will open the new
document and will fill the details and update all the
fields. But, the problem I have is in these templates some
of the text is optional where user has to make choice
between two paragrahs and thereès no way I can cut the
text. So, when user will fill the fields and when he comes
to that paragraphs where he has to choose one how is he
going to choose as all the fields are protected or if he
fills all the details and the again from the beginning he
checks and delete unwanted text - this doesnèt make any
sense to me. Any suggestion appretiated.

Please help.

ANJANA
 
G

Greg Maxey

You could possilby do this two ways.

One is leave the entire form protected and ask the user to
check a box for the paragraph he chooses. The other is to
sandwich unprotected sections in your template that holds
the text you want the user to have the freedom to edit.
Use Insert>Break>Continous. Then use Tools>Protect
Document to select which sections are protected.
 

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