Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Работа с MS Office > Как макросом VBA вызвать редактор формул Word


Автор: PahRam 28.3.2006, 15:40
Просьба помочь.
Открываю файл, в котором есть формула. С помощью макроса на VBA хочу заставить открыть эту формулу и сделать там изменения, а потом выйти из формулы и передать управление Word'у.

Думаю надо использовать sendkeys.
Спасибо

Автор: StayAtHome 8.4.2006, 23:09
Справка по VBA:
Цитата

DoVerb Method
Requests that an OLE object perform one of its available verbs— the actions an OLE object takes to activate its contents. Each OLE object supports a set of verbs that pertain to that object.
Код
expression.DoVerb(VerbIndex)

expression    Required. An expression that returns an OLEFormat object.
  VerbIndex    Optional Variant. The verb that the OLE object should perform. If this argument is omitted, the default verb is sent. If the OLE object does not support the requested verb, an error will occur. Can be any WdOLEVerb constant.

WdOLEVerb can be one of these WdOLEVerb constants:
wdOLEVerbPrimary Performs the verb that is invoked when the user double-clicks the object.
wdOLEVerbShow Shows the object to the user for editing or viewing. Use it to show a newly inserted object for initial editing.
wdOLEVerbOpen Opens the object in a separate window.
wdOLEVerbHide Removes the object's user interface from view.
wdOLEVerbUIActivate Activates the object in place and displays any user-interface tools that the object needs, such as menus or toolbars.
wdOLEVerbInPlaceActivate Runs the object and installs its window, but doesn't install any user-interface tools.
wdOLEVerbDiscardUndoState Forces the object to discard any undo state that it might be maintaining; note that the object remains active, however.
Пример:
Код

 ActiveDocument.Shapes(1).OLEFormat.DoVerb

Автор: PahRam 10.4.2006, 20:26
StayAtHome,

Спасибо за участие!
Попытаюсь разобраться!
Но уже вижу, что информация для меня очень ценная.

Ещё раз спасибо!

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)