Word 2003 new document on top

G

Greg Oij

Thanks to anyone who can help me solve this problem!

I have an application that pops up a new document next to
an existing document, critiquing the existing one.

I started with Word '97, made modifications to make it
work in Word 2000 when that came out and likewise when
Word XP came out. Works fine in those releases. The
critique is displayed on top (overlaps) of the document
being analyzed.

In Word 2000 and greater, I use
Word.Application.Visible = False to hide the processing
then
Word.Application.Visible = True to display the Word Docs
after the critique is prepared.

In Word 2003, sometimes the document comes up on top of
the critique. Other times, it works just fine (critique
on top). This is confusing for the user.

I use ActiveDocument.ActiveWindow.Caption = "Critique"

I've tried:

Windows("Critique").Activate
ActiveWindow.ActivePane.Activate
ActiveDocument.Activate
Documents("Critique").Activate
Windows("Critique").SetFocus 'Word XP & 03

in assorted orders to no avail.
I've also tried grabbing the document number of the
critique to setfocus and activate with no consistent luck.

This problem appears to be a bug introduced in Word 2003.

Any ideas would be very much appreciated.
I've searched high and low
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Greg,

Declare (Dim) a variable as a document (object), then set that variable to
the critique document, then use the .Activate statement on that variable at
the appropriate time.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
G

Greg Oij

Doug,
Thanks for responding. I've been impressed with many of
your contributions as I've been searching.

Please pardon my ignorance. I'm getting a Type mismatch
compile error...

Dim CritiqueA as Object

Set CritiqueA = "Critique"

I also tried
Dim CritiqueA as Document
Dim CritiqueA as Window

The window with the "Critique" caption is an unsaved Word
Document.

Thanks again for your help.
Greg
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Greg,

Use

Dim CritiqueA as Document
Set CritiqueA = Documents.Add("templatenameifotherthannormal.dot"

later to ensure that document is the active document

CritiqueA.Activate

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
G

Greg Oij

Doug,
There is already a .doc (not .dot) - type document with
caption "Critique" which I am trying to GET ON TOP when
this routine is run. If I try to do a documents.add it
pukes. I looked at all of the other documents.* with no
luck. Again, this display works fine in Word '97, 2000,
and XP, but dies in Word 2003.

Thanks for your help on this.
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

When your application, whatever it is, creates the document that you say has
a "caption" (which is a meaningless term in this context) of "Critique",
that document should be assigned to the object that has been declared to
hold that document so that the document can thereafter be referenced by
referring to that object.

If you do not know how to incorporate this into your code, you should copy
and paste all of the code into a message that you post back here so that we
can see it and tell you how to modify it.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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