View Single Post
 
Old 03-06-2015, 05:35 AM
mrkozmic mrkozmic is offline Windows 8 Office 2013
Novice
 
Join Date: Mar 2015
Posts: 6
mrkozmic is on a distinguished road
Default

I might be wrong, but it looks like the template file is open. It's just not open as a regular file, not included in Documents.Count. There are several indications to that:
1. I can edit the template by referring to thisDocument.
2. I can copy all other things like if the template was open.
3. My code to copy the format works, but only if I set a breakpoint. I think I now why. When I select an image in thisDocument I make it the ActiveDocument and it gets corrupted with respect to the rest of the code. Now, if I set a breakpoint, the document gets focus back, ActiveDocument is corrected and the rest of the code works.

Does that make any sense?

My question is now:
How do I change focus from the template back to the document in VBA. ActiveDocument? Activate does obviously not work.

And finally:
4. When I open a document based on the template and try to delete the template, I get a message that the file is open i MS Word.
Reply With Quote