ReDim error

L

Louise H

I'm working with information from this Microsoft Knowledge Base article: http://support.microsoft.com/default.aspx?scid=kb;en-us;286841. However when I attempted to modify this to suit my purpose I get an error 'Variable not defined' at a line that reads "ReDim Preserve fFieldText(1, iCount + 1)". Can anyone tell me what the macro wants from me at this point? I'm afraid I don't know enough about it

Any help appreciated

Thanks
Louise
 
R

RWN

Did you include all the "Dim" commands as noted in the article?

--
Regards;
Rob
------------------------------------------------------------------------
Louise H said:
I'm working with information from this Microsoft Knowledge Base
article: http://support.microsoft.com/default.aspx?scid=kb;en-us;286841.
However when I attempted to modify this to suit my purpose I get an
error 'Variable not defined' at a line that reads "ReDim Preserve
fFieldText(1, iCount + 1)". Can anyone tell me what the macro wants from
me at this point? I'm afraid I don't know enough about it!
 
D

Doug Robbins - Word MVP

Have you created both the applicable one of the Macro1 examples AND the
Macro2? Both of them are required.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Louise H said:
I'm working with information from this Microsoft Knowledge Base article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;286841. However when
I attempted to modify this to suit my purpose I get an error 'Variable not
defined' at a line that reads "ReDim Preserve fFieldText(1, iCount + 1)".
Can anyone tell me what the macro wants from me at this point? I'm afraid I
don't know enough about it!
 
L

Louise H

Aha. That was my silly mistake - took out a line that was needed! I have gotten a little further along and fixed a few more errors, but have another one I don't know how to fix: The debugger takes me t

' Find and replace placeholders with form fields
doFindReplace iCount, fField, fFieldText(

and tells me 'Compile Error: Sub or Function not defined'

I took a stab in the dark and put ActiveDocument. in front of doFindReplace but got a 'not supported' message so that was wrong

If it's pertinent: I don't actually want to do the mail merge, just the basics of it within the one document - store the text from the form fields, have placeholders, (pause here and edit the document if I so wish), and then return the placeholders to form fields containing text

Thanks for the heads-up so fa

Louise H
 
D

Doug Robbins - Word MVP

See my earlier response. It sounds like you have not created the second
macro

Sub doFindReplace(iCount As Integer, fField As FormField, fFieldText() As
String)

As the article says, YOU NEED BOTH OF THEM!


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Louise H said:
Aha. That was my silly mistake - took out a line that was needed! I have
gotten a little further along and fixed a few more errors, but have another
one I don't know how to fix: The debugger takes me to
' Find and replace placeholders with form fields.
doFindReplace iCount, fField, fFieldText()

and tells me 'Compile Error: Sub or Function not defined'.

I took a stab in the dark and put ActiveDocument. in front of
doFindReplace but got a 'not supported' message so that was wrong.
If it's pertinent: I don't actually want to do the mail merge, just the
basics of it within the one document - store the text from the form fields,
have placeholders, (pause here and edit the document if I so wish), and then
return the placeholders to form fields containing text.
 
D

Doug Robbins - Word MVP

Make sure that you don't have a typo somewhere. You can spend hours looking
and not find them.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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