ole Automation and Word 
Author Message
 ole Automation and Word

Hello,

I have two simple questions on this subject.  First, I wanted to double check
on the routines to make sure that Word is not minimized and is also maximized.
I just wanted to check on what the two commands are for this.

Second, my application allows the user to do ole automation.  A few of my users
utilize this for complex tasks that I have not figured out how to do yet with
the built in ActiveX text control.  However, there is one machine where Word
opens but is minimized at the task bar (works find on all the other machines).
The ironic thing is that that machine worked fine a few weeks ago.  I was
wondering what could have caused this change (is there a Word or registry
setting somewhere).  I'm thinking it's something in Word but I'm also thinking
that there are some automation commands I can use to ensure that Word opens up
maximized.

Thanks.

Mike



Thu, 19 Feb 2004 02:33:17 GMT  
 ole Automation and Word
Hello,

loWord = createobject("Word.Application")
loWord.windowstate = 1 && maximized
loWord.show

--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP7

Quote:

> Hello,

> I have two simple questions on this subject.  First, I wanted to double check
> on the routines to make sure that Word is not minimized and is also maximized.
> I just wanted to check on what the two commands are for this.

> Second, my application allows the user to do ole automation.  A few of my users
> utilize this for complex tasks that I have not figured out how to do yet with
> the built in ActiveX text control.  However, there is one machine where Word
> opens but is minimized at the task bar (works find on all the other machines).
> The ironic thing is that that machine worked fine a few weeks ago.  I was
> wondering what could have caused this change (is there a Word or registry
> setting somewhere).  I'm thinking it's something in Word but I'm also thinking
> that there are some automation commands I can use to ensure that Word opens up
> maximized.

> Thanks.

> Mike



Thu, 19 Feb 2004 05:05:10 GMT  
 ole Automation and Word
Eric,

The loWord.Show gives me an ole error code unknown name.  I can do the
loWord.windowstate but not the show and not the Open.  So I have been using
createobject("word97")  but the problem with this is when I createobject word97
I can't do a windowstate = 1.  I get a Property Windowstate not found.

Quote:
>Subject: Re: ole Automation and Word

>Date: 9/1/2001 2:05 PM Pacific Daylight Time

>Hello,

>loWord = createobject("Word.Application")
>loWord.windowstate = 1 && maximized
>loWord.show

Mike


Thu, 19 Feb 2004 05:57:04 GMT  
 ole Automation and Word
Eric,

thanks for the help.  I got it all figured out now.  I have a class called
Word97 and there is a property that stores the object and I have to reference
the property.

Thanks again.

Mike



Thu, 19 Feb 2004 06:28:34 GMT  
 ole Automation and Word
One Problem ---

for some reason when Word opens, I see nothing but a rulerbar - there are no
toolbars and no menu.  Any ideas here?

Thanks.

Mike



Thu, 19 Feb 2004 06:34:22 GMT  
 ole Automation and Word
You're correct. The Show method is from my custom wrapper class.... Sorry for the inconvenience. You need to set loWord.visible =
.T.

--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP7

Quote:

> Eric,

> The loWord.Show gives me an ole error code unknown name.  I can do the
> loWord.windowstate but not the show and not the Open.  So I have been using
> createobject("word97")  but the problem with this is when I createobject word97
> I can't do a windowstate = 1.  I get a Property Windowstate not found.

> >Subject: Re: ole Automation and Word

> >Date: 9/1/2001 2:05 PM Pacific Daylight Time

> >Hello,

> >loWord = createobject("Word.Application")
> >loWord.windowstate = 1 && maximized
> >loWord.show

> Mike



Thu, 19 Feb 2004 18:43:34 GMT  
 ole Automation and Word
No idea. I cant test it here because I do not have word97 on my pc. Only Word2k and WordXP and there doesnt seem to be a problem
with that. What happens if you open a document:

loWord = CREATEOBJECT("Word.Application")
loWord.windowstate = 1
loWord.documents.open("c:\mydoc.doc")
loWord.visible = .T.

--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP7

Quote:

> One Problem ---

> for some reason when Word opens, I see nothing but a rulerbar - there are no
> toolbars and no menu.  Any ideas here?

> Thanks.

> Mike



Thu, 19 Feb 2004 18:46:53 GMT  
 ole Automation and Word
Check menu "window->open". It opens a window for the active document.

Robert



Quote:
> No idea. I cant test it here because I do not have word97 on my pc. Only

Word2k and WordXP and there doesnt seem to be a problem
Quote:
> with that. What happens if you open a document:

> loWord = CREATEOBJECT("Word.Application")
> loWord.windowstate = 1
> loWord.documents.open("c:\mydoc.doc")
> loWord.visible = .T.

> --
> Eric den Doop
> www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP7




Quote:
> > One Problem ---

> > for some reason when Word opens, I see nothing but a rulerbar - there
are no
> > toolbars and no menu.  Any ideas here?

> > Thanks.

> > Mike



Thu, 19 Feb 2004 18:53:57 GMT  
 ole Automation and Word
I finally figured out why I was not getting the full menu in word and only the
ruler bar.  I was maximizing word BEFORE loading the document:

loWord.windowstate = 1

Apparently Word does not like that.  If I open the document first and THEN
maximize word, everything is fine.

Thanks again.

Mike



Fri, 20 Feb 2004 02:29:28 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Foxpro 7.0 OLE automation with Word XP.

2. VFP5 OLE Automation Error (Word '97)

3. OLE Automation with WORD and VFP3.0b

4. Question about OLE automation between Word & VFP

5. OLE Automation of Word

6. VFP OLE automation with Word

7. Can OLE automation of Word use an existing instance of the program?

8. Word 97 OLE Automation error

9. OLE Automation of Microsoft Word

10. OLE Automation of Microsoft Word

11. OLE Automation, Word 9 and fast machines

12. Make Word print to different printers using OLE Automation

 

 
Powered by phpBB® Forum Software