word macro with formular editor

H

Hannes

Hi,
I'm wirting a document with a lot of formulars in it. And I'd like that the
character size in the formulars is just like the circumfluent text. Usualy
once I have created the fomular the character size does not change
automatically. So I started to program a word macro

Dream result: The Word macro goes through the document and for every
formular it checks the circumfluent character size and sets the character
size in the current formular accordingly.
Problem: I don't know, how to set the formulas character size from VBA.

So let's look for an other solution.
Minimal reslut: If I open a formular by doubleclicking it and the object's
flag PreserveFormattingOnUpdate is set to true, then the equation editor sets
the character size in the current formular as it was set last time. So lets
set one formulars character size by hand, fix it to one size for one document
and just open every formular and close it again.
Problem: I don't know, how to close the equation editor. It works well
for small documents but once I've got hunderts of them there appears an
equation editor error saying something like to many windows opened. And
sometimes after running the macro the formulars are drawn correctly but I
can't open them any more with the equation editor. It seem's that word has
lost the conection of the formulars object to the equation editor.

Thank's for your help in advance
Hannes
 
R

Russ

Hi Hannes,
Playing around with an equation, I found out it is a WordArt object and the
size can be adjusted by opening the WordArt format dialog, here is some
sample code made while recording a macro and changing the size of an
equation.

Selection.InlineShapes(1).Fill.Visible = msoTrue
Selection.InlineShapes(1).Fill.Solid
Selection.InlineShapes(1).Fill.ForeColor.RGB = RGB(0, 128, 128)
Selection.InlineShapes(1).Fill.Transparency = 0#
Selection.InlineShapes(1).Line.Weight = 0.75
Selection.InlineShapes(1).Line.Transparency = 0#
Selection.InlineShapes(1).Line.Visible = msoFalse
Selection.InlineShapes(1).LockAspectRatio = msoTrue
Selection.InlineShapes(1).Height = 108#
Selection.InlineShapes(1).Width = 95.75
Selection.InlineShapes(1).PictureFormat.Brightness = 0.5
Selection.InlineShapes(1).PictureFormat.Contrast = 0.5
Selection.InlineShapes(1).PictureFormat.ColorType = msoPictureAutomatic
Selection.InlineShapes(1).PictureFormat.CropLeft = 0#
Selection.InlineShapes(1).PictureFormat.CropRight = 0#
Selection.InlineShapes(1).PictureFormat.CropTop = 0#
Selection.InlineShapes(1).PictureFormat.CropBottom = 0#


CommandBars("WordArt").Visible = False
 

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