Wordbasic.getformresult$("text1") doesn't work

B

Bob Alston

Why doesn't this work:

dim x as string
x = Wordbasic.getformresult$("text1")

I get an error of "bad parameter"

I am using Word 2003 with all updates applied.

It is easy to reproduce.
Open a blank Word document.
create a form field
Set the default value to anything you want.
Run my vba code.

I understood that word basic commands such as this ARE a part of VBA,
accessible via the Wordbasic. method.

Yes I could use
x = activedocument.formfields("text1")

However I need SPEED as my document has 1177 fields in it.

I found that

wordbasic.setformresult("text1"),"whatevertext"

is about 60 times faster than

activedocument.formfields("text1").result = "whatevertext"

I have seen this problem reported before but with no response.
Howefully one of you MVPs will reply, perhaps with a solution.

Bobalston9 AT yahoo D O T com
 
B

Bob Alston

Why doesn't this work:

dim x as string
x = Wordbasic.getformresult$("text1")

I get an error of "bad parameter"

I am using Word 2003 with all updates applied.

It is easy to reproduce.
Open a blank Word document.
create a form field
Set the default value to anything you want.
Run my vba code.

I understood that word basic commands such as this ARE a part of VBA,
accessible via the Wordbasic.   method.

Yes I could use
x = activedocument.formfields("text1")

However I need SPEED as my document has 1177 fields in it.

I found that

wordbasic.setformresult("text1"),"whatevertext"

is about 60 times faster than

activedocument.formfields("text1").result = "whatevertext"

I have seen this problem reported before but with no response.
Howefully one of you MVPs will reply, perhaps with a solution.

Bobalston9   AT   yahoo   D O T   com

Found that wordbasic.getbookmark$("text1") works just fine

Bob
 
D

Doug Robbins - Word MVP

Use

MsgBox ActiveDocument.FormFields("text1").Result

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
Why doesn't this work:

dim x as string
x = Wordbasic.getformresult$("text1")

I get an error of "bad parameter"

I am using Word 2003 with all updates applied.

It is easy to reproduce.
Open a blank Word document.
create a form field
Set the default value to anything you want.
Run my vba code.

I understood that word basic commands such as this ARE a part of VBA,
accessible via the Wordbasic. method.

Yes I could use
x = activedocument.formfields("text1")

However I need SPEED as my document has 1177 fields in it.

I found that

wordbasic.setformresult("text1"),"whatevertext"

is about 60 times faster than

activedocument.formfields("text1").result = "whatevertext"

I have seen this problem reported before but with no response.
Howefully one of you MVPs will reply, perhaps with a solution.

Bobalston9 AT yahoo D O T com

Found that wordbasic.getbookmark$("text1") works just fine

Bob
 

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