limit to (Text) arg in TypeText() method?

R

Rick Charnes

I notice that when I record a new macro from Word (Tools | Macro |
Record New Macro) and the macro includes a lot of straight text typing,
the resultant code consists of many separate TypeText() statements, each
with its (Text) argument consisting of 60 or so characters. Why does
Word do it like that? That [Text] arg can be longer than 60 chars, yes?
What is the limit? Thanks much.
 
H

Helmut Weber

Hi Rick,
I notice that when I record a new macro from Word (Tools | Macro |
Record New Macro) and the macro includes a lot of straight text typing,
the resultant code consists of many separate TypeText() statements, each
with its (Text) argument consisting of 60 or so characters. Why does
Word do it like that? That [Text] arg can be longer than 60 chars, yes?
What is the limit? Thanks much.
Why does Word do it like that?

who knows,
maybe 60 characters was a nice value to split lines.
That [Text] arg can be longer than 60 chars, yes?

indeed. Try:

Selection.TypeText Text:= ActiveDocument.Range.Text

until system crashes.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
R

Rick Charnes

Does anyone know what the limit is? I guess I could just try it myself,
increasing it until my system crashes!

Hi Rick,
I notice that when I record a new macro from Word (Tools | Macro |
Record New Macro) and the macro includes a lot of straight text typing,
the resultant code consists of many separate TypeText() statements, each
with its (Text) argument consisting of 60 or so characters. Why does
Word do it like that? That [Text] arg can be longer than 60 chars, yes?
What is the limit? Thanks much.
Why does Word do it like that?

who knows,
maybe 60 characters was a nice value to split lines.
That [Text] arg can be longer than 60 chars, yes?

indeed. Try:

Selection.TypeText Text:= ActiveDocument.Range.Text

until system crashes.
 
K

Klaus Linke

About 64kB characters (65536), I think. If you need to insert longer text,
..InsertAfter is better.

Regards,
Klaus


Rick Charnes said:
Does anyone know what the limit is? I guess I could just try it myself,
increasing it until my system crashes!

Hi Rick,
I notice that when I record a new macro from Word (Tools | Macro |
Record New Macro) and the macro includes a lot of straight text typing,
the resultant code consists of many separate TypeText() statements, each
with its (Text) argument consisting of 60 or so characters. Why does
Word do it like that? That [Text] arg can be longer than 60 chars, yes?
What is the limit? Thanks much.
Why does Word do it like that?

who knows,
maybe 60 characters was a nice value to split lines.
That [Text] arg can be longer than 60 chars, yes?

indeed. Try:

Selection.TypeText Text:= ActiveDocument.Range.Text

until system crashes.
 
J

Jezebel

65534 is the max.

Try --

selection.TypeText string(65535, "X")






Klaus Linke said:
About 64kB characters (65536), I think. If you need to insert longer text,
.InsertAfter is better.

Regards,
Klaus


Rick Charnes said:
Does anyone know what the limit is? I guess I could just try it myself,
increasing it until my system crashes!

Hi Rick,

I notice that when I record a new macro from Word (Tools | Macro |
Record New Macro) and the macro includes a lot of straight text typing,
the resultant code consists of many separate TypeText() statements,
each
with its (Text) argument consisting of 60 or so characters. Why does
Word do it like that? That [Text] arg can be longer than 60 chars,
yes?
What is the limit? Thanks much.

Why does Word do it like that?

who knows,
maybe 60 characters was a nice value to split lines.

That [Text] arg can be longer than 60 chars, yes?

indeed. Try:

Selection.TypeText Text:= ActiveDocument.Range.Text

until system crashes.
 

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