VBA MailMerge length > 255 <p>i'm trying to use MailMerge with Word 2010.</p> <p>I have a TAB delimited file database.dat which looks like the following:</p> <pre><code>ID Name Street 1 John FooBar 1 2 Smith FooBar 2 </code></pre> <p>This file is used in Word with the following VBA Code:</p> <pre class="lang-vb prettyprint-override"><code>ActiveDocument.MailMerge.OpenDataSource Name:="C:/database.dat", _ ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _ AddToRecentFiles:=False, Revert:=False, Format:=wdOpenFormatAuto </code></pre> <p>I can use the fields from the file now in the text. So everything works fine.</p> <p><strong>The Problem:</strong></p> <p>I need to do some further elaboration with the data in VBA, so I fetch the MergeField Value with:</p> <pre class="lang-vb prettyprint-override"><code>Function getInfoField(mergefield As String) On Error GoTo MergeFieldNotFound: getInfoField = ActiveDocument.MailMerge.DataSource.DataFields(mergefield).Value GoTo EndFunc MergeFieldNotFound: getInfoField = "" EndFunc: End Function </code></pre> <p>But if the length of a merge field value exceeds 255 characters it is cut off. So if I insert</p> <pre class="lang-vb prettyprint-override"><code>MsgBox Len(ActiveDocument.MailMerge.DataSource.DataFields(mergefield).Value) </code></pre> <p>It outputs 255 for a String with e.g. 500 chars.</p> <p>But directly in the word document, all 500 chars are shown for the merge field.</p> <p><strong>Question:</strong></p> <p>How can I get more than 255 chars out of the merge field in VBA?</p>