Simple Question (Switching between Windows)

F

frank

I have an easy one. I have two documents open. One called "New Document"
the other called "Transcript". I need a way to switch back and forth between
documents using the document names and not the window numbers (windows(1)).

I need to use document names because these two documents might be different
numbers depending on which one I open first.

I'm using a macro to copy text from one and pasting to the other. That's
why I need some way to activate one doc to copy text then activate the other
to paste the text.

Thanks
 
P

Perry

I don't use names or index numbers for documents, although you can do it
this way...
I use pointers or object variables pointing to documents (or their windows)

Exmpl

set doc1 = documents.add
set doc20 = documents.open("c:\temp\transscript.doc")

'regardless how many documents are open, below line will never fail
'when it comes to localising either source- or destination document
'and you don't need names to do so ...

doc1.content = doc20.content

But again, as stated, you can also use the names and or index numbers to
identify the documents.

Krgrds,
Perry
 

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