Syntax Question - Regarding variables and object model reference

J

Johan Axelsson

Hi!

I want to use a variabel to access objects in the
ThisDocument object. But I can't get it to work. Probably
very simple.

example:

I want to access this field ThisDocument.addressfield.Value

by doing
Dim str as String
str = "addressfield"

ThisDocument.str.Value 'This Doesn't work. how do I do
this.

BR,
Johan
 
M

Malcolm Smith

Johan

I've answered this to you elsewhere today.

You are confusing a string with an object. Just because the value of the
string is the same and the Name of an object there is no connection
between the two.

What you have to do is to go through the collection of Form Fields on the
document (as I remember this is what you are looking for) with a
For...Next loop and then compare the .Name property of each Form Field
object with the value of the string.

When the two match then you can proceed further.

- Malc
www.dragondrop.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top