

Word documents open how to#
Control how to open Word documents from the internet or an intranet through Windows If you have a different version of Windows, a different browser, or a different version of Internet Explorer, the instructions might be slightly different. This page is written specifically about Windows XP and Internet Explorer version 6. This page is about how to control how to open a Word document from the internet or an intranet.

When you click on a link to a Word document, it can display in your web browser, or it can display within Word itself. Use the File Types command within Windows to control how a Word document displays in Internet Explorer.Ī web page on the internet or on an intranet can contain a link to a Word document. item(1).Word does not control how a Word document displays in Internet Explorer. Particularly if you try andĬlose/delete objects in a collection starting at. Valid before deleting or moving it within the collection you may If you manipulate the Documents collection (or any other) withoutĪssuring that the document or other object is still there and This advice holds for any other object or property you may

Word is an 'open' application platform.and the user can be doing things you didn't count That the doc object still exists before you try and manipulate it. Referring to the document object (named doc, above) can cause Use the ReadOnlyRecommended property set to False with the Tidying up multiple versions of any other documents I open/manipulate in my Word applicationsīecause of this design flaw in Office Open/ Close/ Save methods. To deal with this problem, I've had to develop an elaborate system of creating/saving and 'release' the filename and you get a ' file busy' message, or message about 'creating If you want to re-open the document after closing it It works, but there should be a better solution.īeware that there are a variety of problems that can be encountered:
Word documents open code#
The code I've found to work around this amounts to simulating the process of selecting END PROCESS in task manager. If you're not careful you'll end up with multiple WINWORD processes,viewable in task manager, regardless of whether you Close or Quit them in your code. I run into this a lot with excel VBA, and Word VBA seems to function identically in that regard.Īlso, VBA is flaky about releasing application objects. IF there's any doubt you're better off referring to a document through the Documents collection, though this can also cause errors if the document is no longer open, and you might have to resort to iterating through the collection to be sure the document is, in fact, open. It is important to be careful with ActiveDocument, because it's not always self-evident what actions, in code or elsewhere, will make a document 'active' (i have no proof but even an autosave might do it). By opening the document with your code you make it the active document, which you then close in the next line and try to activate in the next, and this fails because the document is no longer open. I haven't really been able to find much documentation about this, so thanks in advance for any suggestions and insight! Activate on the already active document cause an error? Open on a document explicitly set the Document to be the ActiveDocument? Also, does calling. Activate, it appears that ActiveDocument is set to the origDoc document, even if there were other documents already opened (I'm not really sure how the Documents Collection is managed, and how Word determines what next ActiveDocument would be if you programatically close the current ActiveDocument) My thought was that I needed to call Activate to ensure that the original document was the ActiveDocument, but I'm getting a 4160 'Bad file name' error on the. The user opens a document in Word 2003, and within the Normal.dot AutoOpen macro, we look at current document, and if it has been opened by clicking on a link on a webpage, and meets certain other application specific criteria, close the streamed 'copy' and open the source document (found on a shared drive we can assume the user has access to): Documents.Open origDocĭocuments(ActiveDocument.FullName).Close SaveChanges:=wdDoNotSaveChanges I'm hoping a VB/VBA expert can help me out.
