Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSWord2K... trouble opening multiple documents

Status
Not open for further replies.

Gameboy9

Programmer
Jun 8, 2001
39
US
In the load event of this form: PUBLIC oWord

When I unload: RELEASE oWord

When I want to edit a proposal or two, I use this block:
TRY
oWord.Documents.Open(***)
CATCH && In case there's no Word open or Word was closed
oWord = CREATEOBJECT("Word.Application")
oWord.Documents.Open(***)
ENDTRY
oWord.Visible = .t.

Here's the problem though: I can open one document fine, but the program completly ignores me when I try to open a second document; it's like it didn't open at all.

What am I doing wrong? Thanks again!
 
Hi

The problem could be that the document is not available.
Otherwise it works.

But the way to go will be

IF ! FILE(cFile)
cFile = GETFILE("DOC")
ENDIF
IF !EMPTY(cFile)
IF VARTYPE(oWord) # "O"
oWord = CREATEOBJECT("Word.Application")
ENDIF
oWord.Documents.Open(***)
oWord.Visible = .t.
... whatever...
ENDIF

:)

____________________________________________
ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
Hi

Sorry for the error...

IF ! FILE(cFile)
cFile = GETFILE("DOC")
ENDIF
IF !EMPTY(cFile)
IF VARTYPE(oWord) # "O"
oWord = CREATEOBJECT("Word.Application")
ENDIF
oWord.Documents.Open(cFile)
oWord.Visible = .t.
... whatever...
ENDIF


____________________________________________
ramani - (Subramanian.G) :)
When you ask VFP questions, please add VFP version.
 
Ramani:

I solved my own problem - I had to use UNC because... that's how Netware Servers work; I don't assume drive letters... but I guess the particular UNC I was using was too long or something? I tried a shorter UNC and it worked fine.

I guess it had to be one of those limitations I keep running into.

Thanks for helping, though. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top