Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 30th, 2005, 01:00 PM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to insert an equation in a Word doc. Thru VBA?

I want to insert an equation in a Word document thru VBA using the equation editor. I try using the macro recorder but it opens the editor and ends. It did not record the equation I wrote.
I also try using the "sendkey" instruction but it does not work as it would has to.
Can anybody help me?

Thanks, Pedro.

PD.: If you don´t know the answer, please do not type nonsense.


 
Old May 31st, 2005, 12:36 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I think that if I were you, I would add an equation object, then use VBA to examine the object (Find out its type, properties, etc.).

You can write a routine that will work with that which is currently selected, then select the equation object and call your routine. Out a breakpoint into the routine. When the VBA editor gets the focus, and the code is halted on the breakpoint, you can start examining the object.

If you
Code:
    Dim obj As Object
    Set obj = Selection.CurrentSelection ' (or whatever the proper property is)
    then you can highlihgt 'obj', right-click on that highlighting, and select 'Add to Watch Window' from the context popup.

I suspect this is going to take some research...





Similar Threads
Thread Thread Starter Forum Replies Last Post
printing a word doc from badgolfer ASP.NET 1.0 and 1.1 Basics 2 December 13th, 2013 07:06 AM
Creating word doc - word behaviour mat41 Classic ASP Professional 2 April 29th, 2007 06:46 PM
Copy text from 1 doc to other doc thru vba in word itchock Word VBA 2 December 29th, 2006 02:47 AM
Word Doc from Database NinaWilliam ASP.NET 1.0 and 1.1 Basics 2 August 22nd, 2006 11:41 PM
Copy word to word doc. in VB vamshi Pro VB 6 1 March 24th, 2004 06:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.