Solved

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

Posted on 2007-03-22
1
286 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

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 is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

738 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