|
-
Jul 10th, 2002, 02:00 PM
#1
Thread Starter
New Member
OLE Ms Word part II
Thanks for your replies people, but my problem (or error) remains.
When I use the <Set objWord = Nothing> command and i want to restart Ms Word for the second time from my vb program after it's been shut down(Ms Word), the same error occurs: RUN TIME ERROR the remote machine does not exits or is unavailable. It looks like i can't empty the var objWord or something like that ?!
I appreciate your help !
I tried the following but the error emains:
*** Form 1 ***
Public objWord As Word.Application
Private Sub cmdStart_Click()
Dim range1 As Range
Dim DocNaam As String
Dim DezeDoc As Document
Set objWord = new Word.Application
objWord.Visible=True
With objWord
.documents.Add
DocNaam = .ActiveDocument.Name
set DezeDoc = .Documents(DocNaam)
set range1 = DezeDoc.Range
range1.InsertAfter "test"
range1.PageSetup.Topmargin = CentimetersToPoints (3.5)
End With
Load temp
End Sub
***Temp***
Private Sub Form_Load()
Unload Form1
SubSet objWord = Nothing
Form1.Show
End
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
|