Results 1 to 2 of 2

Thread: Weird, OLD, question concerning Basic in Word 6.0

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2006
    Posts
    19

    Weird, OLD, question concerning Basic in Word 6.0

    Right now I'm writing a program that opens a text file in Word 6.0, runs a macro from its list, and then closes word, and the VB program that starts it initially.

    I'm using VB.Net to make the Word Program start with this code:

    VB Code:
    1. Dim Word As Object                    'Declare an object variable
    2.         Word = CreateObject("Word.Basic") 'Set the object pointer
    3.         Word.FileOpen("O:\TEMP\datamax.txt")
    4.         Word.ToolsMacro("Steel", True)       'Run the macro called Steel
    5.         Word.FilePrint()
    6.         Me.Close()

    It seems to work fine.. all but the print, which I'll get to in a second.

    I also have a looooong ass macro formatting the .txt document preparing it to print. This is where the problems come in.

    Firstly, for this step in the macro:

    Code:
    InsertObject .FileName = "J:\DWG\PDF\35EG0069.PDF", .Class = "AcroExch.Document.7", .Caption = "Adobe Acrobat '7.0 Document"
    I'm embedding an Adobe .pdf file into the middle of the word document. It works fine, except that it prompts me for what file I want to open with a dialog box. Shouldnt the
    Code:
    .FileName = "J:\DWG\PDF\35Eg0069.PDF"
    cover that? Why is the dialog box still coming up and how do I get it to go away?


    Secondly, When I run this macro from Word 6.0 it runs perfectly, apart from the dialog box. However, when I run it from the call in my new VB program, it skips the print. It even has in the status bar, "Preparing to print in the background" finishes, closes, but no print.

    ANY help on these would be amazing. I know it's an old program, and not much fun or easy... but Please help me if you happened to know any of the answers! Thanks!

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Weird, OLD, question concerning Basic in Word 6.0

    word6 will not continue to print once it is closed, so you could delay between print and close, till the printing is finished.

    is your insert object in a with block?, try putting in the full object name

    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width