Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2005

Tip: Looking for answers? Try searching our database.

How to stop word displaying on the screen

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Bugden - 22 Jun 2005 19:42 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.