Hi,
I have written some code to open create a word object and save a word
document as html.
THis works fine, except that the document flashes up on the screen briefly.
I have set the visible propery to false, is there something else I need to do?
The code below is late bound, but I get the same effect with early binding.
Any suggestions very gratefully received.
Steve.
Dim strWordFileName as string = "myfilename.doc"
Dim strHTMLFileName as string ="myfilename.htm"
Dim MSWord As Object
MSWord = CreateObject("Word.Application")
MSWord.Visible = False
MSWord.Documents.Open(FileName:=strWordFileName, ReadOnly:=True)
MSWord.ActiveDocument.SaveAs(FileName:=strHTMLFileName, FileFormat:=10)
MSWord.Documents.Close()
MSWord.Quit()
MSWord = Nothing
Anand.V.V.N - 23 Jun 2005 07:36 GMT
Hi Steve,
I used the following line and I was successfuly in not displaying the
application. This might work
word.Application.Visible=False
Anand

Signature
"Who will guard the guards?"
> Hi,
>
[quoted text clipped - 21 lines]
> MSWord.Quit()
> MSWord = Nothing
Steve Bugden - 23 Jun 2005 13:59 GMT
Hi,
Many thanks for the reply. I tried the suggestion but unfortunately I still
get Word flashing up on the screen.
I am using Word 2002 by the way.
Regards,
Steve Bugden.
> Hi Steve,
>
[quoted text clipped - 30 lines]
> > MSWord.Quit()
> > MSWord = Nothing
Anand.V.V.N - 24 Jun 2005 05:59 GMT
Hi Steve,
By the way are you using it in VBA? or calling your code from a user form?

Signature
"Who will guard the guards?"
> Hi,
>
[quoted text clipped - 41 lines]
> > > MSWord.Quit()
> > > MSWord = Nothing
Steve Bugden - 24 Jun 2005 10:13 GMT
Hi Anand,
No, I am running from visual studio.net 2003. Sorry I should have said before.
Thanks for following my question up.
Steve
> Hi Steve,
>
[quoted text clipped - 45 lines]
> > > > MSWord.Quit()
> > > > MSWord = Nothing