Solved

VBA Text Form field .result won't accept string longer than 255 characters

Posted on 2007-03-22
1
285 Views
Last Modified: 2013-11-26
I am investigating a problem in VBA which is part of some code running in an MS Word Document. The code is attempting to copy the data from one Text from field object to another. This is being done by the .result method.
The method is working in terms of getting the data out of the form field and putting it into a string. However there is a problem when using the .result method again to put the value into the new field if the string is longer than 255 characters. Does anyone know why this is and if there is a work around?
0
Comment
Question by:carljokl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 24

Accepted Solution

by:
R_Rajesh earned 500 total points
ID: 18781673
There is no reason for why some things are the way they are with microsoft :)

ActiveDocument.Unprotect
ActiveDocument.FormFields(1).Range.Fields(1).Result.Text = (String(300, "X"))
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True

http://support.microsoft.com/kb/163192
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

756 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