Solved

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

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…

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