Solved: Word Macro to issue a Message on the fly.

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

jglong3

Thread Starter
Joined
Jul 23, 2003
Messages
141
Hello, :) :) :)

And, THANKS for your time, help, and advice!!!!

I have not created macros in a long time and I am having some trouble remembering how to accomplish the following, if it can be done at all.
And, I am using an older version of VB that was loaded with Word and Excel 97.

A Word Macro has been created to process data in a file. First, a MsgBox was used to show the progress of the Macro but the MsgBox cannot be made to continue without responding to OK.

Is there is a way to issue a MsgBox on the fly without requiring a response?

Otherwise, a text box has been inserted on the front end of the file being processed to put a text message in the text box to show the progress of the Macro. The Macro in this case is in the NORMAL area of WORD. If an attempt is made to set text in the text box (TextBox1) an OBJECT error is displayed:

TextBox1.Text = "The Macro Proccess is Here: Location ABC"

An attempt to put the Macro in NORMAL for ThisDocument will display the same OBJECT error.

If the Macro is put in the PROJECT area of ThisDocument the OBJECT of the TextBox1 can be seen and setting the TextBox1.Text code will work.

It would be nice if the Macro could be in the Normal area. An attempt was made to CreateObject as well as GetObject so the Macro can be executed from the Normal area.

However, there has been no success to set the correct arguments for CreateObject or GetObject so that the Object of the TextBox1 is created.

The following has been tried:

CreateObject(Word.ThisDocument.Activate)

with several variations of the arguments. The attempts do not create the TextBox1 Object.

Can anybody show me the error of my ways?

Thanks for your time, help, and advice.

Jerry
 

jglong3

Thread Starter
Joined
Jul 23, 2003
Messages
141
Hello,,, :) :)

Thanks for those who looked at this,,,,,I apologize that this was not responded to the moment a solution was found for the textbox1 object in the NORMAL area of VB. After about an hour of poking around the following was the answer and it seems to be simple:

Set TextBoxShape = ActiveDocument.Shapes(1).OLEFormat.Object
TextBoxShape.Text = "This is Process Level xyz at time: " & CStr(Time)

Jerry
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top