> I have no problem running your code - it runs completely invisible on my PC.
> Have you tried to run the same code on another machine?
I ran it from vb6 ide and from Word macro and it run fine in both cases.
However, when I added some stuff to the body of the with construct, it
chocked on the line .Range.text = "Hello, world!". It looks like a bug in
Word to me. Fortunately, workaround is easy, don't put the "visible"
parameter to documents.add method. Word is already hidden, you don't need it
there. This is my version of the procedure:
Private Sub Form_Load()
Dim appWord As Word.Application
Dim docWord As Word.Document
Set appWord = New Word.Application
With appWord
.ScreenUpdating = False
.Visible = False
.WindowState = wdWindowStateMinimize
' Blob appears
Set docWord = .Documents.Add '(Visible:=False)
With docWord
.Range.Text = "Hello, world!"
.SaveAs "c:\test.doc"
' Makes blob disappear
'.ActiveWindow.Visible = False
' Do stuff here
.Close wdDoNotSaveChanges
End With
' Blob appears, then goes away
.Quit
End With
Set docWord = Nothing
Set appWord = Nothing
End Sub

Signature
Please reply to NG only. This email is not monitored.
Alex.
>> I have no problem running your code - it runs completely invisible on my
> PC.
[quoted text clipped - 6 lines]
>
> If not, from which app did you run the code?
Alex Ivanov - 18 Apr 2005 07:25 GMT
I forgot to mention that it's better to use
appWord.Quit wdDoNotSaveChanges
It will ensure that all open docs are closed before quitting with no prompt
to save changes. You won't need to call docWord.Close explicitly in this
case.

Signature
Please reply to NG only. This email is not monitored.
Alex.
>I ran it from vb6 ide and from Word macro and it run fine in both cases.
>However, when I added some stuff to the body of the with construct, it
[quoted text clipped - 40 lines]
>>
>> If not, from which app did you run the code?
Howard Kaikow - 18 Apr 2005 10:56 GMT
> I forgot to mention that it's better to use
> appWord.Quit wdDoNotSaveChanges
> It will ensure that all open docs are closed before quitting with no prompt
> to save changes. You won't need to call docWord.Close explicitly in this
> case.
I never need to use wdDoNotSaveChanges as I always have my code do what is
needed and using that parameter would hide errors from me, inadvertently
losing changes that should be saved.
In any case, this particual app does not need that because the file has
already been saved prior to the close.
Howard Kaikow - 18 Apr 2005 14:35 GMT
FYI
The same problem occurs automating Word from VB .NET using Word 2003.
So I guess the problem is either with Word or 3rd party apps interfering
with the OLE.
Gotta go to the dentist, I'll try to construct a fresh example after I get
back.

Signature
http://www.standards.com/; See Howard Kaikow's web site.
> I forgot to mention that it's better to use
> appWord.Quit wdDoNotSaveChanges
[quoted text clipped - 46 lines]
> >>
> >> If not, from which app did you run the code?
Howard Kaikow - 18 Apr 2005 10:38 GMT
I ran into the same problem running from within Word 2003.
I also ran into the same problem using VB 6 and Word 2002.
I then tried VB 6 with Word 97, which forced me to remove the .Visible for
the doc as that is not supported for word 97.
So, I need to try removing .Visible in Word 2003.

Signature
http://www.standards.com/; See Howard Kaikow's web site.
> I ran it from vb6 ide and from Word macro and it run fine in both cases.
> However, when I added some stuff to the body of the with construct, it
[quoted text clipped - 40 lines]
> >
> > If not, from which app did you run the code?
Howard Kaikow - 18 Apr 2005 10:52 GMT
> I ran it from vb6 ide and from Word macro and it run fine in both cases.
> However, when I added some stuff to the body of the with construct, it
> chocked on the line .Range.text = "Hello, world!". It looks like a bug in
> Word to me. Fortunately, workaround is easy, don't put the "visible"
> parameter to documents.add method. Word is already hidden, you don't need it
> there.
I tried eliminating the visibility stuff.
Same problem, unless I insert a break in the code.
The problem could be caused by 3rd party apps such as Norton Auntie Virus
2004 or OmniPage Office Pro or ... interfering with the OLE.
I have other code in which hiding Word does work in Word 2003 does work.
I'll have to try to find out what, if anything, that code does differently.