1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

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

Discussion in 'Business Applications' started by jglong3, Jul 6, 2007.

Thread Status:
Not open for further replies.
  1. jglong3

    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
     
  2. jglong3

    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
     
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 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/592573

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice