Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2005

Tip: Looking for answers? Try searching our database.

Sendkeys in Equation Editor

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dennis S - 19 Sep 2005 20:35 GMT
I am trying to use SendKeys to configure the Equation Editor.  I have
similair code for defining format spacing that works fine, but I am having a
problem setting the Styles definitions.  Below is the code to change the
"Text" in the equation editor to Arial.   It does not seem to work:

Dim ReturnValue
ReturnValue = Shell(C:\Program Files\Common Files\Microsoft
Shared\Equation\EQNEDT32.EXE",1)
AppActivate ReturnValue
SendKeys "%S", True
SendKeys "+D", True
Sendkeys "{TAB}{TAB}Arial{ENTER}",True

Any other suggestion?
macropod - 25 Sep 2005 07:40 GMT
Hi Dennis,

You could use an EQUATION field (or an empty field) instead of the Equation
Editor, and simply input the text in whatever format you require.

For example (based on a solution I provided for another thread recently):

Sub Overline()
Dim sChar As String
Dim i As Integer
sChar = InputBox("Enter characters to overline", "Overline")
With Selection
   For i = 1 To Len(sChar)
       .Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
       PreserveFormatting:=False
       .Delete Unit:=wdCharacter, Count:=1
       With .Font
           .Name = "Arial"
           .Size = 22
           .Bold = True
       End With
       .TypeText Text:="EQ \s\up6(\f(," + Mid(sChar, i, 1) + "))"
       .Fields.Update
       .MoveRight Unit:=wdCharacter, Count:=1
   Next
End With
End Sub

Cheers

> I am trying to use SendKeys to configure the Equation Editor.  I have
> similair code for defining format spacing that works fine, but I am having a
[quoted text clipped - 10 lines]
>
> Any other suggestion?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.