MitchellVII
asked on
Access Memo Fields being truncated when imported in Form Fields.
Hi,
I have a Mail Merge Document that contains { FORMTEXT } Form Fields corresponding to all of the .MailMerge.DataSource.Data Fields values in my document. I run the following code to populate the { FORMTEXT } Form Fields with my MERGE data:
'Fills Form Fields with data from matching MergeFields:
Dim mmdf As MailMergeDataField
For Each mmdf In ThisDocument.MailMerge.Dat aSource.Da taFields
ThisDocument.FormFields(mm df.Name).R esult = ThisDocument.MailMerge.Dat aSource.Da taFields(m mdf.Name). Value
Next
This works perfectly; however, I have noticed that when one of my DataFields is a LONG STRING, it truncates the text in my Form Field, although my Form Field is set to TEXT | UNLIMITED. My .DataSource is a .txt file emported from Access.
Anyone know why this is and how to overcome it?
Mitchell
I have a Mail Merge Document that contains { FORMTEXT } Form Fields corresponding to all of the .MailMerge.DataSource.Data
'Fills Form Fields with data from matching MergeFields:
Dim mmdf As MailMergeDataField
For Each mmdf In ThisDocument.MailMerge.Dat
ThisDocument.FormFields(mm
Next
This works perfectly; however, I have noticed that when one of my DataFields is a LONG STRING, it truncates the text in my Form Field, although my Form Field is set to TEXT | UNLIMITED. My .DataSource is a .txt file emported from Access.
Anyone know why this is and how to overcome it?
Mitchell
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That one made my brain hurt. Ok, how would I apply that to this code:
'Fills Form Fields with data from matching MergeFields:
Dim mmdf As MailMergeDataField
For Each mmdf In ThisDocument.MailMerge.Dat
ThisDocument.FormFields(mm
Next
if I have an Access Memo Field called "ContactSynopsis" that is a MERGEFIELD which I want to use to populate my FORMTEXT field by the same name? Here is their code for reference:
Sub WorkAround255Limit()
' Set Text1 form field to a unique string.
ActiveDocument.FormFields(
If ActiveDocument.ProtectionT
ActiveDocument.Unprotect
End If
Selection.GoTo What:=wdGoToBookmark, Name:="Text1"
Selection.Collapse
Selection.MoveRight wdCharacter, 1
Selection.TypeText (String(256, "W"))
Selection.GoTo what:=wdGoToBookmark, Name:="Text1"
' Remove unique characters from Text1 form field.
With Selection.Find
.Execute findtext:="*", replacewith:="", replace:=wdReplaceAll
End With
ActiveDocument.Protect Password:="", NoReset:=True, Type:= _
wdAllowOnlyFormFields
End Sub
P.S., did you see my question regardind coloring table cells? That's a toughie I think :)
M