|
-
Jul 6th, 2006, 05:04 PM
#1
Thread Starter
Junior Member
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:
Dim Word As Object 'Declare an object variable
Word = CreateObject("Word.Basic") 'Set the object pointer
Word.FileOpen("O:\TEMP\datamax.txt")
Word.ToolsMacro("Steel", True) 'Run the macro called Steel
Word.FilePrint()
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!
-
Jul 8th, 2006, 03:37 AM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|