Reply
 
Thread Tools Display Modes
  #1   Report Post  
Bryan L
 
Posts: n/a
Default Add checkboxes with macro in Merge document?

Our 3rd-party management system stores Word templates within its database.
We use their proprietary interface for selecting Form Letters to merge (or
edit), but the merged document or template itself opens up in Word. I
mention this at the outset in case it affects any answers.

We frequently merge customer data into these form letters, and that works
fine. I'm trying something new, however. I'd like to incorporate simple
checkboxes into some of the Form Letters used internally by employees to
submit, for example, a check request. Some of the relevant data pulls from
the customer's account, but there are quite a few other mulitple-choice
questions the user has to answer, and checkboxes would be ideal for that.

I found a fairly simple macro that works in conjuction with bookmarks to
make checkboxes behave the way I want. It uses bookmarks to define a group
of checkboxes so that only one checkbox within the group can be checked.
Marking a checkbox within the group causes all other checkboxes in the group
to deselect, so only one box at a time can be selected. This macro works
fine, but I have two problems:

1. When I save the template and then merge a document into it, the
merged document does not contain the bookmarks defined in the template.
However, if I open the template directly for editing, the bookmarks are
still there.

2. Locking the form (so the checkboxes will work) also locks the user
out of the other cells in the table. (For the sake of a clean layout that's
easy to read and navigate I've laid out the document using tables.) I think
this means one of two things: I either need to leave sections that must be
user-editable out of tables, or I need to add form fields to the cells where
I want them to enter data so when I lock the form, they have access to the
form fields I've created. Is there another option for me? Can I
selectively UN-protect the specific table cells that I wish users to use for
data entry? Do I need to similarly unprotect cells that contain merge
fields?

Thanks in advance,

Bryan



  #2   Report Post  
cynjor312
 
Posts: n/a
Default Add checkboxes with macro in Merge document?

Bryan L:
I know you were expecting an answer but your post caught my eye regarding
checkboxes. I am working on our application, placed form fields where info is
needed to be filled in and noticed my checkboxes can both be checked at the
same time. i don't want this. how did you get it to where you can only select
one while the others are deselected? NOTE: I am working with Word 2000

"Bryan L" wrote:

Our 3rd-party management system stores Word templates within its database.
We use their proprietary interface for selecting Form Letters to merge (or
edit), but the merged document or template itself opens up in Word. I
mention this at the outset in case it affects any answers.

We frequently merge customer data into these form letters, and that works
fine. I'm trying something new, however. I'd like to incorporate simple
checkboxes into some of the Form Letters used internally by employees to
submit, for example, a check request. Some of the relevant data pulls from
the customer's account, but there are quite a few other mulitple-choice
questions the user has to answer, and checkboxes would be ideal for that.

I found a fairly simple macro that works in conjuction with bookmarks to
make checkboxes behave the way I want. It uses bookmarks to define a group
of checkboxes so that only one checkbox within the group can be checked.
Marking a checkbox within the group causes all other checkboxes in the group
to deselect, so only one box at a time can be selected. This macro works
fine, but I have two problems:

1. When I save the template and then merge a document into it, the
merged document does not contain the bookmarks defined in the template.
However, if I open the template directly for editing, the bookmarks are
still there.

2. Locking the form (so the checkboxes will work) also locks the user
out of the other cells in the table. (For the sake of a clean layout that's
easy to read and navigate I've laid out the document using tables.) I think
this means one of two things: I either need to leave sections that must be
user-editable out of tables, or I need to add form fields to the cells where
I want them to enter data so when I lock the form, they have access to the
form fields I've created. Is there another option for me? Can I
selectively UN-protect the specific table cells that I wish users to use for
data entry? Do I need to similarly unprotect cells that contain merge
fields?

Thanks in advance,

Bryan




  #3   Report Post  
Charles Kenyon
 
Posts: n/a
Default Add checkboxes with macro in Merge document?

What you are talking about is what Word calls an "online form." For more
about online forms, follow the links at
http://addbalance.com/word/wordwebresources.htm#Forms or
http://word.mvps.org/FAQs/Customizat...nTheBlanks.htm especially Dian
Chapman's series of articles. You may also want to look at
http://www.word.mvps.org/FAQs/TblsFl...nesInForms.htm.

See especially
http://word.mvps.org/FAQs/TblsFldsFm...FmFldChbxs.htm.

Hope this helps,
--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

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

See also the MVP FAQ: http://word.mvps.org/FAQs/ 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.
"cynjor312" wrote in message
...
Bryan L:
I know you were expecting an answer but your post caught my eye regarding
checkboxes. I am working on our application, placed form fields where info
is
needed to be filled in and noticed my checkboxes can both be checked at
the
same time. i don't want this. how did you get it to where you can only
select
one while the others are deselected? NOTE: I am working with Word 2000

"Bryan L" wrote:

Our 3rd-party management system stores Word templates within its
database.
We use their proprietary interface for selecting Form Letters to merge
(or
edit), but the merged document or template itself opens up in Word. I
mention this at the outset in case it affects any answers.

We frequently merge customer data into these form letters, and that works
fine. I'm trying something new, however. I'd like to incorporate simple
checkboxes into some of the Form Letters used internally by employees to
submit, for example, a check request. Some of the relevant data pulls
from
the customer's account, but there are quite a few other mulitple-choice
questions the user has to answer, and checkboxes would be ideal for that.

I found a fairly simple macro that works in conjuction with bookmarks to
make checkboxes behave the way I want. It uses bookmarks to define a
group
of checkboxes so that only one checkbox within the group can be checked.
Marking a checkbox within the group causes all other checkboxes in the
group
to deselect, so only one box at a time can be selected. This macro works
fine, but I have two problems:

1. When I save the template and then merge a document into it, the
merged document does not contain the bookmarks defined in the template.
However, if I open the template directly for editing, the bookmarks are
still there.

2. Locking the form (so the checkboxes will work) also locks the user
out of the other cells in the table. (For the sake of a clean layout
that's
easy to read and navigate I've laid out the document using tables.) I
think
this means one of two things: I either need to leave sections that must
be
user-editable out of tables, or I need to add form fields to the cells
where
I want them to enter data so when I lock the form, they have access to
the
form fields I've created. Is there another option for me? Can I
selectively UN-protect the specific table cells that I wish users to use
for
data entry? Do I need to similarly unprotect cells that contain merge
fields?

Thanks in advance,

Bryan






  #4   Report Post  
Charles Kenyon
 
Posts: n/a
Default Add checkboxes with macro in Merge document?

Protected forms and mailmerge do not work well together. As you've
discovered, merging a document strips bookmarks.

If you are merging a single data record, the following procedure may work.

Unprotect your template.
Create a new document based on the template and link it to your merge source
record.
Display the merged data in your new document but do not merge to the printer
or to a document.
Lock your document for forms and use the checkboxes.
Unlock the document if you need to do more editing.
Print and save the new document.

I also unlink merge fields and make the document a non-merge document using
a macro:

Sub UnmergeThis()
' Written 29 August 2002 by Charles Kyle Kenyon
' Updated 23 September 2002 to attach normal.dot
' Remove merge codes from document, remove from merge status
'
' Test for template - in template only disconnect from merge but leave
merge fields active
'
On Error Resume Next
If ActiveDocument.Type = wdTypeTemplate Then
'
' Test for merge document - do not run if not merge document
'
If MergeTest() = False Then ' private function call
Exit Sub
End If
'
' Disconnect template from merge data
ActiveDocument.MailMerge.MainDocumentType = wdNotAMergeDocument
Application.CommandBars("MergeK").Visible = False
Exit Sub
End If
'
' Test for merge document - do not run if not merge document
'
If MergeTest() = False Then
Exit Sub
End If
'
Dim oField As Field
Dim vMsgBoxResponse As Variant
Dim sUserTemplates As String
'
' Double check with user because permanent operation
'
vMsgBoxResponse = MsgBox(Prompt:= _
"This will disconnect this document from the merge file." _
& vbCrLf & "This cannot be undone." & vbCrLf & vbCrLf _
& "Continue?", Buttons:= _
vbQuestion + vbYesNo + vbDefaultButton1, _
Title:="Continue?")
If vMsgBoxResponse vbYes Then
MsgBox Prompt:="No changes made to document.", _
Title:="Merge connection still active."
Exit Sub
End If
'
' OK to continue
'
Application.ScreenUpdating = False
'
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldMergeField Then
oField.Unlink
End If
Next oField
'
ActiveDocument.MailMerge.MainDocumentType = wdNotAMergeDocument
'
' Disconnect from template - attach normal.dot
'
sUserTemplates =
Application.Options.DefaultFilePath(wdUserTemplate sPath)
If Right(sUserTemplates, 1) "\" Then
sUserTemplates = sUserTemplates & "\"
End If
' sUserTemplates =
Application.Options.DefaultFilePath(wdUserTemplate sPath) & "\"
With ActiveDocument
.UpdateStylesOnOpen = False
.AttachedTemplate = sUserTemplates & "Normal.dot"
End With
Application.ScreenUpdating = True
Application.ScreenRefresh
'
End Sub

--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

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

See also the MVP FAQ: http://word.mvps.org/FAQs/ 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.

"Bryan L" wrote in message
...
Our 3rd-party management system stores Word templates within its database.
We use their proprietary interface for selecting Form Letters to merge (or
edit), but the merged document or template itself opens up in Word. I
mention this at the outset in case it affects any answers.

We frequently merge customer data into these form letters, and that works
fine. I'm trying something new, however. I'd like to incorporate simple
checkboxes into some of the Form Letters used internally by employees to
submit, for example, a check request. Some of the relevant data pulls
from the customer's account, but there are quite a few other
mulitple-choice questions the user has to answer, and checkboxes would be
ideal for that.

I found a fairly simple macro that works in conjuction with bookmarks to
make checkboxes behave the way I want. It uses bookmarks to define a
group of checkboxes so that only one checkbox within the group can be
checked. Marking a checkbox within the group causes all other checkboxes
in the group to deselect, so only one box at a time can be selected. This
macro works fine, but I have two problems:

1. When I save the template and then merge a document into it, the
merged document does not contain the bookmarks defined in the template.
However, if I open the template directly for editing, the bookmarks are
still there.

2. Locking the form (so the checkboxes will work) also locks the user
out of the other cells in the table. (For the sake of a clean layout
that's easy to read and navigate I've laid out the document using tables.)
I think this means one of two things: I either need to leave sections
that must be user-editable out of tables, or I need to add form fields to
the cells where I want them to enter data so when I lock the form, they
have access to the form fields I've created. Is there another option for
me? Can I selectively UN-protect the specific table cells that I wish
users to use for data entry? Do I need to similarly unprotect cells that
contain merge fields?

Thanks in advance,

Bryan





Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge to New Document Template Association Al Mailmerge 2 June 2nd 05 09:11 AM
merge to a fax in 2003 with xp when fax not available (greyed out merging to a fax with printer greyed out Mailmerge 1 May 20th 05 12:54 PM
I can't get a mail merge document to open, I get "the document na. hask104 Mailmerge 0 March 31st 05 01:57 AM
Word Compare and Merge Document Function EricM Microsoft Word Help 2 March 28th 05 11:53 PM
Specific Email Merge w/ Specific Attachements Mark B Mailmerge 9 February 21st 05 06:10 AM


All times are GMT +1. The time now is 12:36 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"