Solved

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

Posted on 2007-03-22
1
284 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
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
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 …

808 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