Text Box position and size

O

Oz Springs

Hello

I have created a macro (as usual by recording it, then adapting it later) to
place a text box in a document.

The first recorded line is this:

ActiveDocument.shapes.AddTextbox(msoTextOrientationHorizontal, 43.05,_
615.2, 432#, 120#).Select

Can anyone tell me what the numbers refer to and in what measurement are
they (points, centimetres, inches - whatever). I might be able to speed up
this macro by putting in the position and size here rather than adjust later
in the macro.

Many thanks



Oz
 
J

JE McGimpsey

Oz Springs said:
I have created a macro (as usual by recording it, then adapting it later) to
place a text box in a document.

The first recorded line is this:

ActiveDocument.shapes.AddTextbox(msoTextOrientationHorizontal, 43.05,_
615.2, 432#, 120#).Select

Can anyone tell me what the numbers refer to and in what measurement are
they (points, centimetres, inches - whatever). I might be able to speed up
this macro by putting in the position and size here rather than adjust later
in the macro.

Since you're reading the code in the VBE, and want to learn to edit it,
I'll simply point you to the best source for that information:

Look up "AddTextbox" in the VBE's Help. You'll see it finds the
"AddTextbox Method". There's a full description of each argument there.

You're right that the macro recorder produces some pretty redundant
code. OTOH, I still record things that I'm not sure about, or am too
lazy to look up. I then edit the recorded output to eliminate as much
fluff as possible.
 
O

Oz Springs

Thanks for this information. I did try to search Visual Basic, but for Text
Box rather than for Textbox. You would think Microsoft could be a bit
consistent here: either calling the ³Text Box² command in the Insert Menu
³Textbox² or allowing us to search for ³Text Box² in VB Help.

Kind regards



Oz

PS are you able to help me with the macros lines mentioned in my reply
regarding Macro for bookmarks in footer sent at GMT 15:34? If not, that¹s
fine.
 
J

JE McGimpsey

Oz Springs said:
Thanks for this information. I did try to search Visual Basic, but for Text
Box rather than for Textbox. You would think Microsoft could be a bit
consistent here: either calling the ³Text Box² command in the Insert Menu
³Textbox² or allowing us to search for ³Text Box² in VB Help.

Well, indexing is an Art, and MS hasn't been much of an artist in
previous versions. Help in Office 2004 is actually pretty good
(especially when compared to the degrading of Help in WinOffice 2003).

When you know the method name, though, using that will always find what
you're looking for.
 
J

John McGhie

Hi Oz:

John and I answered that one: your "best" answer is a change of approach.

Opening the header/footer window to select stuff is always going to be a
problem because how you get there depends on where you are at the moment.

Better to use a field whose properties you can manipulate directly with an
InputBox or Userform.

BTW: The Microsoft VBA Help tends to be very consistent, once you know that
it's built from an SGML database using the names of things exactly as they
appear in the code :)

But it also supports wild cards and natural language searching :)

Cheers


Thanks for this information. I did try to search Visual Basic, but for Text
Box rather than for Textbox. You would think Microsoft could be a bit
consistent here: either calling the ³Text Box² command in the Insert Menu
³Textbox² or allowing us to search for ³Text Box² in VB Help.

Kind regards



Oz

PS are you able to help me with the macros lines mentioned in my reply
regarding Macro for bookmarks in footer sent at GMT 15:34? If not, that¹s
fine.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Consultant Technical Writer
Sydney, Australia +61 4 1209 1410
 

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