Reply
 
Thread Tools Display Modes
  #1   Report Post  
Darryl Kerkeslager
 
Posts: n/a
Default Lost form fields after merge

TextInput type FormFields are lost when doing a Mail Merge, but the
fix that MS has proposed is inadequate for my purposes.
http://support.microsoft.com/?kbid=286841


The Word fill-in forms that I have been given - and cannot substantially
alter - have blank Word *form* fields - textInput, checkbox, and combobox
form fields. Some of these, I want to merge data into, some of these I
don't, but instead want them to be left blank for the user to fill in
manually *after the merge*. Although checkboxes and comboboxes remain after
the merge, any unfilled textInput boxes are not present in the newly created
document. The user cannot then tab between the unfilled Word form fields
and fill them in.

Microsoft's workaround above is about the same as mine - I put the text
"ff" in the original doc, and then use vba to replace that with a form
field (from Access):

..Application.Selection.Find.ClearFormatting
Do While .Application.Selection.Find.Execute _
(FindText:="ff", Wrap:=wdFindContinue, Forward:=True) = True
.ActiveDocument.FormFields.Add _
Range:=.Application.Selection.Range, Type:=wdFieldFormTextInput
Loop

My main problem is that so far, I can only add a field - I cannot then
re-create the formatting that the original designers of the Word Document
intended
(underline, maximum width 2, uppercase, etc).



Darryl Kerkeslager

Power corrupts.
Absolute power corrupts absolutely.
Knowledge is power.
See www.adcritic.com/interactive/view.php?id=5927


  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

I can only suggest that you add a little bit more info to each ff tag to
store the formatting information you want and use it after the merge to
restore the formatting and so on.

e.g. if you want underline, set the field up as ff_underline, parse the
info. in your macro and apply the necessary properties. In this case, you
might be slightly better off inserting the fields you want by hand, then
using another bit of VBA to examine their properties and generate a "field
name" that encodes the information you want to transfer.

Peter Jamieson
"Darryl Kerkeslager" wrote in message
...
TextInput type FormFields are lost when doing a Mail Merge, but the
fix that MS has proposed is inadequate for my purposes.
http://support.microsoft.com/?kbid=286841


The Word fill-in forms that I have been given - and cannot substantially
alter - have blank Word *form* fields - textInput, checkbox, and combobox
form fields. Some of these, I want to merge data into, some of these I
don't, but instead want them to be left blank for the user to fill in
manually *after the merge*. Although checkboxes and comboboxes remain
after
the merge, any unfilled textInput boxes are not present in the newly
created
document. The user cannot then tab between the unfilled Word form fields
and fill them in.

Microsoft's workaround above is about the same as mine - I put the text
"ff" in the original doc, and then use vba to replace that with a form
field (from Access):

.Application.Selection.Find.ClearFormatting
Do While .Application.Selection.Find.Execute _
(FindText:="ff", Wrap:=wdFindContinue, Forward:=True) = True
.ActiveDocument.FormFields.Add _
Range:=.Application.Selection.Range, Type:=wdFieldFormTextInput
Loop

My main problem is that so far, I can only add a field - I cannot then
re-create the formatting that the original designers of the Word Document
intended
(underline, maximum width 2, uppercase, etc).



Darryl Kerkeslager

Power corrupts.
Absolute power corrupts absolutely.
Knowledge is power.
See www.adcritic.com/interactive/view.php?id=5927




  #3   Report Post  
Darryl Kerkeslager
 
Posts: n/a
Default

"Peter Jamieson" wrote
I can only suggest that you add a little bit more info to each ff tag to
store the formatting information you want and use it after the merge to
restore the formatting and so on.

e.g. if you want underline, set the field up as ff_underline, parse the
info. in your macro and apply the necessary properties.


Drat! I had hoped for a more elegant solution, but it seems that this
problem has no elegant solution, only work-araounds.


In this case, you might be slightly better off inserting the fields you
want by hand, then using another bit of VBA to examine their properties
and generate a "field name" that encodes the information you want to
transfer.


How do I put the information back in? For instance, I use this to add the
form field:

..ActiveDocument.FormFields.Add _
Range:=.Application.Selection.Range, Type:=wdFieldFormTextInput

How do I then say, "and make that form field two characters wide"?


--
Darryl Kerkeslager

Power corrupts.
Absolute power corrupts absolutely.
Knowledge is power.
See www.adcritic.com/interactive/view.php?id=5927


  #4   Report Post  
Peter Jamieson
 
Posts: n/a
Default

How do I then say, "and make that form field two characters wide"?

Something like:

Dim oFormField as FormField
Set oFormField =
ActiveDocument.FormFields.Add(Range:=Application.S election.Range, _
Type:=wdFieldFormTextInput)
With oFormField.TextInput
.Width = 2
End With

(You may find some of the relevant properties in the oFormField, and some in
oFormField.TextInput).

Drat! I had hoped for a more elegant solution, but it seems that this
problem has no elegant solution, only work-araounds.


Yes, there seem to have been many lost design opportunities in this area.

Peter Jamieson

"Darryl Kerkeslager" wrote in message
...
"Peter Jamieson" wrote
I can only suggest that you add a little bit more info to each ff tag to
store the formatting information you want and use it after the merge to
restore the formatting and so on.

e.g. if you want underline, set the field up as ff_underline, parse the
info. in your macro and apply the necessary properties.


Drat! I had hoped for a more elegant solution, but it seems that this
problem has no elegant solution, only work-araounds.


In this case, you might be slightly better off inserting the fields you
want by hand, then using another bit of VBA to examine their properties
and generate a "field name" that encodes the information you want to
transfer.


How do I put the information back in? For instance, I use this to add the
form field:

.ActiveDocument.FormFields.Add _
Range:=.Application.Selection.Range, Type:=wdFieldFormTextInput

How do I then say, "and make that form field two characters wide"?


--
Darryl Kerkeslager

Power corrupts.
Absolute power corrupts absolutely.
Knowledge is power.
See www.adcritic.com/interactive/view.php?id=5927



  #5   Report Post  
Darryl Kerkeslager
 
Posts: n/a
Default

"Peter Jamieson" wrote
How do I then say, "and make that form field two characters wide"?


Something like:

Dim oFormField as FormField
Set oFormField =
ActiveDocument.FormFields.Add(Range:=Application.S election.Range, _
Type:=wdFieldFormTextInput)
With oFormField.TextInput
.Width = 2
End With

(You may find some of the relevant properties in the oFormField, and some
in oFormField.TextInput).



Thank you for the help. I guess I have a lot of looking at the Word Object
Model ahead of me. At least now I know where to start.


--
Darryl Kerkeslager

Power corrupts.
Absolute power corrupts absolutely.
Knowledge is power.
See www.adcritic.com/interactive/view.php?id=5927


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
ASK and FILLIN fields in INCLUDETEXT documents do not merge correc ChrisM Mailmerge 3 April 12th 05 04:05 AM
Proteced Form with Mail Merge Section-Mail Merge is "lost" whe F. Ferrer Microsoft Word Help 0 February 2nd 05 09:27 PM
Can you create a multi-layered merge where certain merge fields a. mileszat Mailmerge 3 January 18th 05 04:46 AM
Email a protected document that contains Text Form Fields Dowza New Users 1 January 8th 05 11:31 AM
Using MAILMERGE fields within HYPERLINK fields for Merge to Email Mark V Mailmerge 2 December 4th 04 05:01 PM


All times are GMT +1. The time now is 07:12 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"