|
-
Jun 13th, 2000, 10:31 PM
#1
Thread Starter
Addicted Member
Hi,
can anyone let me know how to print a string using the word application object model.
I think it should be simple but don't know the correct objects to use. Put simply I have a string which I want to print from VB, via MS word without showing the word application.
Thanks in advance.
Lenin
-
Jun 13th, 2000, 11:44 PM
#2
Addicted Member
First of all, add a reference to you project for the Microsoft Word 8.0 Object library. Then this will work:
Dim WordApp As Word.Application
'Starting Word
Set WordApp = New Word.Application
WordApp.Application.Visible = False
WordApp.Documents.Add
WordApp.ActiveDocument.Words(1).InsertAfter "New text "
WordApp.ActiveDocument.PrintOut Background:= False
WordApp.Documents.Close wdDoNotSaveChanges
WordApp.Application.Quit
Set WordApp = Nothing
-
Jun 14th, 2000, 03:06 PM
#3
Thread Starter
Addicted Member
HDR,
many thanks, that is exactly what I required.
Lenin
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
|