473,698 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Read all FormFields from a Word form into a VBA array

1 New Member
Hi,
My first post here so I hope this goes OK!

I am using VBA in Excel 2003 (Windows XP) to cycle through a set of Word files which are questionnaire returns using form fields. It all works fine, but I hoped to get a way to read all the elements of the FormFields() array in each Word document in one pass per document, to reduce the time taken (there are 118 form fields per document).

Currently I am using a loop for each Word file to read each result one at a time into my VBA array:

Expand|Select|Wrap|Line Numbers
  1.       For Qnum = 1 To HowMany
  2.     Answers(Qnum - 1) = .FormFields(Qnum).Result
  3. Next Qnum
Working on the basis that once the array is filled, I can return it to the spreadsheet in one pass with:

Expand|Select|Wrap|Line Numbers
  1. Range("A2").Resize(1, HowMany).Value = Answers()
what I wanted was something like:

Expand|Select|Wrap|Line Numbers
  1. Answers() = .FormFields().Result
However, that just gives the error:
Compile error: Method or data member not found

I've searched all the places I know and found nothing that helps.

Many thanks in advance,

Nic
Jun 5 '07 #1
0 1193

Sign in to post your reply or Sign up for a free account.

Similar topics

0
6097
by: Grant Gardiner | last post by:
This is an interesting one... You have a Word document with a parent table. Inside this is another table. This subtable has 4 columns, where I need to dynamically insert FormFields into each cell when I add a new row. Problem. Using the function below the oFormField object only ever points to the first of the newly inserted FormFields!?! The First cell in the newly appended row ends up being named Text2_4 instead of Text2_1.
8
5158
by: Darryl Kerkeslager | last post by:
I hope that although this is 25% Access and 75% Word, that someone will know ... The whole problem here arises because 1) Microsoft acknowledges an 'issue' wherein TextInput type FormFields are lost when doing a MailMerge and 2) the fix that they have proposed is both inadequate and won't work from Access. http://support.microsoft.com/?kbid=286841 The part of the code below that actually performs the merge is great; the core of it is...
2
2378
by: roz | last post by:
Hello, I'm fairly new to VB programming and I've been going round the bend with this problem, so any nudges or shoves in the right direction would be greatly appreciated. I have a template form in Word. The information that I need to populate this form is from 2 tables in an Access 2002 database (patient details and GP details). Once the user has entered the patient and GP etc details, they need to produce a case summary (including...
13
24455
by: dmj07 | last post by:
Hi all, I have a simple table set up in which a user can insert values into the boxes and onkeydown it will sum up the column. Table: <table> <tr> <td><input type="text" onkeydown="calcTotal(this, 'tot')" /></td>
0
8600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9155
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8858
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7711
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5859
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4360
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3038
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.