VBA: Windows("filename.doc").Activate

J

John Kilcullen

Windows("output.doc").Activate

and the like do not seem to work in VBA for Word X for Mac OSX.

Is there a Mac equivalent?

John Kilcullen
 
J

JE McGimpsey

John Kilcullen said:
Windows("output.doc").Activate

and the like do not seem to work in VBA for Word X for Mac OSX.

Is there a Mac equivalent?

As long as you have a file named output.doc open

Windows("output.doc").Activate

works fine in Word v.X/VBA. What "like" are you referring to, and what
does "do not seem to work" mean to you (e.g., run-time errors? crashes?
nothing? the wrong thing?)?
 
G

Guest

Thanks for your answer.
The procedure starts with several documents open, including
output.doc.
The lines of code which produce an error message read:

'select extract
Selection.WholeStory
Selection.Copy

'paste into output file and process
Windows("output.doc").Activate
Selection.WholeStory
Selection.Paste
Call zCet2Source

The procedure would continue, including several stages in
which other documents are activated (process.doc,
source.doc, extract.dot -- that's what I mean by "the
like", I assume that none of them will work). The procedure
runs satisfactorily in Word 2000 for Windows. When I try to
run it in Word X for Macintosh, I get the error message
"Runtime error 5941 The requested member of the collection
does not exist", and debug highlights
Windows("output.doc").Activate

Output.doc is in fact open, and so are the other documents
to be activated at later stages.

John Kilcullen
 
J

JE McGimpsey

When I try to run it in Word X for Macintosh, I get the error message
"Runtime error 5941 The requested member of the collection does not
exist", and debug highlights Windows("output.doc").Activate

Output.doc is in fact open, and so are the other documents
to be activated at later stages.

Hmm... Are you sure it's "output.doc" that is open, and not just
"output"? MacWord doesn't automatically add the extension when it
creates a file.

Otherwise, I'm not sure what's going on.
 
J

john kilcullen

I seem to have fixed the problem by reducing the demand on
memory. Thanks for your comments.

John Kilcullen
 
J

JE McGimpsey

john kilcullen said:
I seem to have fixed the problem by reducing the demand on
memory. Thanks for your comments.

Just for my edification, how did you do that?
 

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