Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Access Memo Fields being truncated when imported in Form Fields.

Posted on 2006-03-28
2
Medium Priority
?
280 Views
Last Modified: 2008-02-01
Hi,

I have a Mail Merge Document that contains { FORMTEXT } Form Fields corresponding to all of the .MailMerge.DataSource.DataFields 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.DataSource.DataFields
    ThisDocument.FormFields(mmdf.Name).Result = ThisDocument.MailMerge.DataSource.DataFields(mmdf.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
0
Comment
Question by:MitchellVII
2 Comments
 
LVL 77

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 16313995
This is a known problem.
Microsoft have this as a workaround:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;163192
0
 
LVL 5

Author Comment

by:MitchellVII
ID: 16314195
Wow,

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.DataSource.DataFields
    ThisDocument.FormFields(mmdf.Name).Result = ThisDocument.MailMerge.DataSource.DataFields(mmdf.Name).Value
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("text1").Result = "****"
      If ActiveDocument.ProtectionType <> wdNoProtection Then
          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
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question