Keep the textboxes the same size in VBA?

W

Webtechie

Hello,

I am working my way through programming with Word VBA. I know Excel VBA,
but am just beginning to program with Word VBA.

I have some textboxes that hold chart images as jpg files. There are two
boxes on the page and each box has a chart image in it.

This is a template. When I copy this template into the active document, I
will replace the chart images. However, when I delete the chart image, the
textbox size changes.

I need to keep the report consistent to give it a professional look. How do
you keep the textbox from changing its size while replacing images within a
textbox?

Thanks,

Tony
 
C

Cindy M.

Hi Tony,

Can you please be more specific about what kind of a "textbox" this is? I can
think of at least three things available in the WordUI that call themselves
that...
I am working my way through programming with Word VBA. I know Excel VBA,
but am just beginning to program with Word VBA.

I have some textboxes that hold chart images as jpg files. There are two
boxes on the page and each box has a chart image in it.

This is a template. When I copy this template into the active document, I
will replace the chart images. However, when I delete the chart image, the
textbox size changes.

I need to keep the report consistent to give it a professional look. How do
you keep the textbox from changing its size while replacing images within a
textbox?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
W

Webtechie

Cindy,

I only know of the textbox where you go insert textbox.

In any event, I am creating a report.

I want to be able to go to the end of the template, add a textbox with the
standardtext. However, I need the textbox to stay the same size regardless
of the text being inserted. The reason for this is I am also inserting
graphic images of charts. If the textbox resizes, it throws my report
formatting off.

I'm not sure if in order to keep things standard, it would be better to
create a table and insert text and charts into the table.

If I add text directly into the document, that certainly moves things around.

Tony
 
D

Doug Robbins - Word MVP

Maybe you should use text input formfields in the cells of a table that has
the cell dimensions fixed.

--
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
 
C

Cindy M.

Hi Tony,
I only know of the textbox where you go insert textbox.

Others (off the top of my head):
1. The one in AutoShapes (Drawing tools)
2. The one in the Controls Toolbox toolbar
However, I need the textbox to stay the same size regardless
of the text being inserted. The reason for this is I am also inserting
graphic images of charts. If the textbox resizes, it throws my report
formatting off.

What you're using is a form field, and the form field textbox is
specifically designed to conform to the text flow (expand as the user
types). The best you can do with this type of text box is to limit the
number of characters. As a workaround, as you and Doug say, you could use
a Table to force the report to lay out as you prefer.

FWIW the ActiveX text box, from the Controls Toolbox, can be set to a
specific size. But in contrast to the form field text box it can *never*
go with the text flow (break to a new line at the end of a line). You
should also be aware that inserting an ActiveX control into your document
will activate the macro security.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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