Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

324 views
Skip to first unread message

John Kilcullen

unread,
Jun 6, 2004, 11:31:19 PM6/6/04
to
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

JE McGimpsey

unread,
Jun 7, 2004, 2:50:20 AM6/7/04
to
In article <1911e01c44c3f$e5de0580$a001...@phx.gbl>,
"John Kilcullen" <anon...@discussions.microsoft.com> wrote:

> 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?)?

anon...@discussions.microsoft.com

unread,
Jun 7, 2004, 3:57:44 AM6/7/04
to
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

>.
>

JE McGimpsey

unread,
Jun 7, 2004, 6:19:15 PM6/7/04
to
In article <18fa801c44c65$1d899420$a501...@phx.gbl>,
<anon...@discussions.microsoft.com> wrote:

> 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.

john kilcullen

unread,
Jun 8, 2004, 5:34:57 AM6/8/04
to
I seem to have fixed the problem by reducing the demand on
memory. Thanks for your comments.

John Kilcullen

>.
>

JE McGimpsey

unread,
Jun 8, 2004, 6:01:36 AM6/8/04
to
In article <1989801c44d3b$dc8724b0$a501...@phx.gbl>,
"john kilcullen" <anon...@discussions.microsoft.com> wrote:

> 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?

0 new messages