Solved

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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 …

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now