Word - How to avoid accessing template opening docs

Asked By mustomat on 26-Jun-12 07:05 PM
I need to know how to skip the intial reading of template when opening a
document from VBA
I have a lot of docs in a network folder referencing to an old template
in a location that doesn`t exist anymore and when I try to open them
manually it is trying to access the wrong address that doesn`t exist. In
the lower bar it indicates to use ESC to abort accessing template and it
works and the document opens and I know how to remove the wrong template
manually but the problem is that there are too much docs to do it
manually one by one, so I thought in a VBA macro but I can`t find the
way to avoid the initial access to the template when opening a document
and the macro never ends and the computer hangs. Anybody knows how to
solve that? Thanks in advance.




--
mustomat


Stefan Blom replied to mustomat on 27-Jun-12 05:29 PM
You may have to add a delay to the code, so that the file opens completely
before the macro runs. Look up the Application.OnTime method in Word VBA Help.

Also, if you posted some example code, I am sure someone could help.

--
Stefan Blom
Microsoft Word MVP
mustomat replied to Stefan Blom on 28-Jun-12 12:29 PM
Thanks, Stefan, but the solution with delay is not enough, because the
delay to open each document could be of more than 10 minutes in some
cases (even worst when address begin with a valid external IP) and there
are several hundreds of files to scan, so it could be too much to wait.

The code is not very relevant because I am only trying with a simple For
loop with the files results of a previous search and presently I only
use the open instruction for each file (in the future I thought to put a
check of the template address and the removal of bad addresses, but this
part is not important if I can“t open the files before).

Thanks aganin.  Javier

'Stefan Blom[_3_ Wrote:




--
mustomat
Stefan Blom replied to mustomat on 30-Jun-12 08:35 AM
OK, delays for more than ten minutes certainly present a problem. :-(  If you
do not get a reply here, try the Word Developer forum at
http://social.msdn.microsoft.com/Forums/en-US/worddev/threads or the Word
TechNet forum at http://social.technet.microsoft.com/Forums/en-US/word/threads.

--
Stefan Blom
Microsoft Word MVP