WordApplication.Visible is not setting to True

U

unklevo

I am trying to programaticaly set word application visible=true and it does
not let me.

Dim WordApp As Word.Application = Nothing
WordApp = New Word.Application
WordApp.Visible = True

I am using vb.net 2005 and word 2007

I used to be able to do it easly with word 2003


Any ideas would appreciated.

Thank you
 
F

fumei via OfficeKB.com

Why do you have the = Nothing?
I am trying to programaticaly set word application visible=true and it does
not let me.

Dim WordApp As Word.Application = Nothing
WordApp = New Word.Application
WordApp.Visible = True

I am using vb.net 2005 and word 2007

I used to be able to do it easly with word 2003

Any ideas would appreciated.

Thank you
 
U

unklevo

to init the var and remove compiler warnings

it does not work either way...

Dim WordApp As Word.Application
or
Dim WordApp As Word.Application=nothing
 
D

Doug Robbins - Word MVP on news.microsoft.com

Dim WordApp As Word.Application=nothing

will not compile

You need to use

Dim WordApp As Word.Application
Set WordApp = New Word.Application

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
U

unklevo

Doug,

Thank you for your response.

My is compiling and running. I am using vb.net 2005
See code below:

Dim WordApp as Word.Application
WordApp = New Word.Application

<when I try to set>

WordApp.visible = True

<it still stays and does not change to WordApp.visible = True>
WordApp.visible = False

Igor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top