Deleting the content of a text field

I

info

Hi,

ist there any possibilty to delete the content of a text field with
vba?

Best regards
Tobias Zepf
 
I

info

Hi,

hmm i test your code, but doesn´t work correct. is there a difference
between a text field and a text box. word says that the name of my box
is "Text Box 10". How can i delete the content of this box?

thanks for answers
 
J

Jean-Guy Marcil

(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :
Hi,

hmm i test your code, but doesn´t work correct. is there a difference
between a text field and a text box. word says that the name of my box
is "Text Box 10". How can i delete the content of this box?

You originally asked about a text field (Inserted in a document with the
Forms Toolbar), but are now writing about text boxes (Inserted with the
Controls Toolbar, or on a userform).
Which is it? The code is not the same and will not be stored in the same
place...

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
I

info

I wantr to delete the content of a text box inserted by controls
toolbar. i was troubled with the difference of text field and text box.
sorry about that. text box is in german a "Textfeld". it sounds similar
than text field ;-)
 
H

Helmut Weber

Hallo Tobias,

try:
ActiveDocument.Shapes("Text Box 10").TextFrame.TextRange = ""
or:
ActiveDocument.Shapes("Text Box 10").TextFrame.TextRange.delete

There are very subtle differences between both methods.
Da gibt es ganz feine Unterschiede zwischen den beiden Methoden..
is there a difference between a text field and a text box.

A textformfield is something quite different.
Ein Textformfeld ist etwas ganz anderes.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

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

Helmut Weber

Hi Jean-Guy Marcil,

a lesson in german free of charge

:)

forsthaus = forester's lodge
auerhahn = wood grouse

Have a nice day

Helmut
 

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