Activating Word from Access 2007 problem

A

Anne Schouten

In Access 2007 I try to activate Word.

It Works fine on other computers, but not on mine.

On my computer the macro stops at AppActivate "Microsoft Word" in the
following procedure:



On Error Resume Next

AppActivate "Microsoft Word"

If Err Then ' if
Word is not open

Shell "C:\Program Files\Microsoft Office\Office12\WinWord",
_

vbMaximizedFocus

AppActivate "Microsoft Word"

End If



I have 2 questions:

1. Why does not work the line On Error Resume Next

2. What is wrong with the line AppActivate "Microsoft Word" (if Word
is closed, the Shell opens Word, but again Word cannot be activated)

The error message is: error 5: Invalid procedure call or argument.





Extra information:

1. Other users do not have this problem.

2. I run on my computer Office 2007 and a virtual machine Microsoft
Virtual PC 2007 with Office 97

3. The line AppActivate "Microsoft Excel" Works fine.

4. The line AppActivate Shell("C:\Program Files\Microsoft
Office\Office12\WinWord") opens Word, but gives the same error message



Thanks,

Anne
 
A

Anne Schouten

I found the reason why On Error Resume Next did not work.

In Visual Basis: at Tools - Options - General was selected the option 'Stop
at all errors' (or something like that, I have the Dutch version).
I suppose in this case the option 'Stop with not solved errors' is much
better.
Is the latter the default option?

Anne
 

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