Hello,
I have been trying to programmatically add either an equation field o
using the Equation Editor.
Problem with the Equation Editor is I have only been able to add tex
using "SendKeys" which is not ideal.
I have managed to add an "Equation Field" and I can set the text
however I cannot add carriage returns to the text. Anyone know how?
What I am after is a field which states:
X - Y
______
Z
Can anybody help?
Many Thanks,
Looney
--
Message posted from http://www.ExcelForum.com
Jay Freedman - 20 Nov 2004 13:43 GMT
Hi Looney,
You don't need a carriage return to make that expression with an EQ
field. Use the code
{EQ \f(X - Y, Z)}
The Equation Editor isn't programmable in VBA except by SendKeys,
which is a horrible kluge, but we're stuck with it.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
>Hello,
>
[quoted text clipped - 20 lines]
>---
>Message posted from http://www.ExcelForum.com/
macropod - 22 Nov 2004 08:28 GMT
Hi Looney,
You could use something like:
Sub AddEQ()
Dim FldText As String
FldText = "EQ \f(X - Y,Z)"
Selection.Fields.Add Range:=Selection.Range, Text:=FldText,
PreserveFormatting:=False
End Sub
Cheers
> Hello,
>
[quoted text clipped - 20 lines]
> ---
> Message posted from http://www.ExcelForum.com/