Keeping Documents in Print View

M

mike.wasson

Hi all,
I'm having a problem using VBA to tie together Excel and Word. My
code is completely within Excel, and I'd prefer there to be no macros
inside the Word docs (this is rather easy to solve if you can do that).
Basically, my problem is as follows: what I'm doing is using VBA to
open two different documents, make modifications to both of them, and
then save multiple copies of both. The code to open the documents
looks sort of like this (where objWord is my Word.Application object):

If writeDocA Then
objWord.Documents.Open (docAFilename)
Set docA = objWord.Documents(docAFilename)
End If

If writeDocB Then
objWord.Documents.Open (docBFilename)
Set docB = objWord.Documents(docBFilename)
End If

Both documents are in print view the entire time, including when
they're being modified (it takes long enough that I can look at them as
the macro runs). However, once I look at the saved files, whichever
one was opened first (so, in the above case, docA, but I can switch
them and it'll happen to docB) opens in normal view. The other one
still opens in print view. I'm assuming this error has something to do
with which document is "active," for some definition of active, but I
couldn't get anything to work. Any ideas?

Thanks,
Mike
 

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