Vba Close Word Document

dotm) from the drop down menu, this test VBA program will, in effect, become a part of Word itself because it will then become available for every document you create in Word. The code above is a little less intuitive, so I used the Macro Recorder in VBA to spit out the VBA code for creating a document. Open your Word document. Embed Microsoft Word in VB. Run VBA Code When Documents Open May 25, 2007 By Visio Guy 12 Comments If you've dabbled with the VBA project that resides in Visio documents, then you've likely stumbled upon the Document object's DocumentOpened event. Auto run a macro in MS-Word Hi, Can you help me how can I run a macro automatically when I open the MS-WORD. The commands to save all your documents or close them all are still in Word; they are simply buried and you need to add them to the Quick Access Toolbar. Application") Set oDoc = oWord. A great way of learning about Word VBA is using its macro recording function. Click the Create button. Save Next 'Fermer les documents For Each ledoc In lesdocuments ledoc. SortArray (arrArrayName()). With VBA, you can do a lot of stuff with a workbook object - such as open a specific workbook, save and close workbooks, create new workbooks, change the workbook properties, etc. In today’s article, we want to share you 2 ways to quickly save or close all open Word documents. Now, hit the Visual Basic button from the Developer tab. To test it, you may simply create a Word document with the following macro. The following lines of VBA code can be added to a macro to close a specific file after you change "C:\MyFileFolder\MyFile. This code works to close a PDF document that is open, but how do I kill the Acrobat application or Exit the Acrobat program? "ac. expression A variable that represents a Document object. The closest thing I have found to help me out is a function written on this site called MergeIt(), but when I compile, this line, "Dim objDoc As Word. Word will create a new Template based on the file but will fail to save it in essentially the same way as Word 2003 before it, with one slight difference: if you close Word and you do not have the option set to prompt before saving the Normal Template, Word 2007 will keep on trying and failing to save, but it appears as though it checks the. docm file gives the user an option to open two different. Create new or open a Word document, add paragraphs and text, set formatting settings, import files, insert Access data from tables, save, print. Word supports interacting with it as an automation server, and for working with documents. That will kill Word and you will lose any unsaved data, so you have to be careful using it. After your VBA macro / code has performed all the required actions, you would want the macro to either save the file or skip saving it. Since Powerpoint lacks almost all of the document automation that Word has, the only way to get document properties into a slide is VBA to search a presentation and replace text with a document property. This preserves the document as a "templet". It is OK provided I do not close Word, and it will create multiple instances of the document into the same instance or word. This example closes Word and prompts the user to save each document that has changed since it was last saved. No guarantees are given for any later versions of Word, but most of this code will likely still be valid. In Word for the web, you have to step through such tasks manually. Thank you so much for this. Controlling Word from Excel using VBA Posted on June 22, 2017 April 27, 2019 by Excel Off The Grid This post is the second in a series about controlling other applications from Excel using VBA. How to automatically execute a Word macro when you create, open, or close a document by Susan Harkins in Microsoft Office , in Software on March 17, 2011, 12:57 AM PST. Jordan, Most of what you want to do can be done in VBA (e. Sub TestFileOpened() ' Test to see if the file is open. Try copying the section between the lines into your Visual Basic Editor: ===== Sub RemoveTabs() With ActiveDocument With. Five different code procedures (sometimes called Macros) need to be written. Right-click on ThisDocument for your document and select Insert -> Module. I tried to do this but when I click on the button, the button depresses but nothing else happens (the code doesn’t run). Closing a Word 2010 document when you're finished working with it is simple. Using Bookmarks to Fill in a Word Document from Excel. Application. Closing a Word 2010 document when you’re finished working with it is simple. Global class, so we can omit the Application property. I would declare a document object. Save the document as C:\Yourfile. Hit the Save. You cannot open two documents with the same name, even if the documents are in different folders. To create a new document that uses a specific template, use this: 3. Opening and Closing an Application from VBA This example should work with any VBA program such as Excel, Access & Word Visual Basic for Applications (VBA) is part of all Microsoft Office products, including Excel, Access, Word, and more. This three part tutorial shows you how to build an automatic document template for Microsoft Word. Activate-- Hope this helps. For Word 2007, see Insert headers and footers. When you're done writing a Word document, you just need to do the electronic equivalent of putting it away. That will kill Word and you will lose any unsaved data, so you have to be careful using it. Close Close all Documents without saving. In Visual Basic, click Module on the Insert menu. This three part tutorial shows you how to build an automatic document template for Microsoft Word. any help regarding this is highly thankful. The NewDocument object is Word’s implementation of an office-wide object called NewFile. Save your work in a Word Macro enabled template. I would like to open Word and view the specified document. You want an easy way to close all open documents and want to quit Word at the same time. messages when rerunning the macro, which to VBA will be interpreted as an attempt to re-open a file that is already open. Hi, I want to read line by line of a word document through vba. Visual Basic for Applications (VBA) allows you to access Microsoft Office's document properties (also known as metadata). En constante évolution, n'hésitez pas à nous visiter. Now in this Article i am going to write a function will Select a Range from Excel and paste the content in a New Word Document. Now, hit the Visual Basic button from the Developer tab. Wordを操作する準備VBAは、Excelだけではなく、WordやAccess、PowerPoint、Outlookといった主要なOfficeアプリケーションにも搭載されています。. Close saveChanges:=False. It's quite a long example, but should be a great aid to helping understand how to link applications using VBA. With this feature gone, the recommend method of using Outlook data in Word is mail merge. how to close a specific document using vba i have a vba macro that upon opening of a specific. Application. Ultimate instructions for both Mac and Windows :) How do I select something? Hold down the primary mouse button while dragging your mouse until everything you want (e. First, a procedure to "initialize" the form when it opens; a procedure to respond to. The sub below provides that. Re: Close/Quit Word Application The userform can open up to 25 documents if all are selected. 0 Forms in Excel. Many thanks: Public Function FnOpenWordDoc(strWordDoc). Application") Set oDoc = oWord. The file will open with full access. GrabWordFile = word_server. create another excel with the data, close the word file, copy from the created excel to the template …. A simpler approach is to explicitly run your own Word instance, which you can terminate when finished. This advanced Word VBA macro programming course is designed for users who are already comfortable with the basics of Word VBA macros, and who have progressed beyond relying on the Macro Recorder. It's occasionally convenient to close a document without saving your changes. Effortlessly open Microsoft Word documents from VB Often, your application may have cause to open a Microsoft Word document. Documents("Arrays. Wish List. COM or ActiveX controls. Please kindly show me how I can write another code to close a document that is already opened before I open another one. com Guest columnist Thomas Homan. An OLE file can also contain storages. save as and close file macro by zimmertron | October 4, 2006 12:41 PM PDT Need a macro that saves and closes an MS-Word 2003 file with the first line of the document acting as the file name. For example, the main stream of a MS Word document containing its text is named "WordDocument". If you use the following code to open a Word application and a file what code do you use to close the Word application after I have already closed the file? [vba] Set oWord = CreateObject("Word. With the function, you tell Word to start recording, then perform various steps as if you were working without a macro recorder, and finally, tell Word to stop recording. In Excel workbook, press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window. any help regarding this is highly thankful. dotm) from the drop down menu, this test VBA program will, in effect, become a part of Word itself because it will then become available for every document you create in Word. Now, hit the Visual Basic button from the Developer tab. The Documents property is a member of the Word. 0 Macro Sheets (XLM) in Excel workbooks) VBA modules. A typical MS Word document with VBA macros may look like this:. Re: Close Word document within excel vba I realy need to test if there's more than 1 instance of word, so the code will not close other opened documents, nor leave a "blank" word instance opened after printing, avoidind any prompts. Quit End Function ' Return a sorted list of the string's words. Solved: Excel Macro to Open, Print, and Close an Embedded Word Document? Discussion in ' Business Applications ' started by khvnb , Feb 20, 2009. In this article we will be looking at how to export Access data using VBA code, since even a beginner can use the visual interface to export data. INFO: VBA Example to Use Barcode Functions in MS Word SUMMARY This article provides some information on converting selected text into barcodes using barcode fonts and VBA functions. However, you first need to know the exact name of the properties to be able to access it. Exporting Data from Microsoft Access with VBA Code: Access gives you two ways to export data, visually by going to File-Export and then selecting an export format from a dialog box or by using VBA code. A VBA UserForm is a custom dialog box, to which you can add all the features you would normally see in a regular Windows dialog box like text boxes, combo boxes, option groups, check boxes and more. The code above is a little less intuitive, so I used the Macro Recorder in VBA to spit out the VBA code for creating a document. Word VBA - Close button disable problem (self. To test it, you may simply create a Word document with the following macro. I'm trying to write a macro that closes the active window without saving the document. To open the second document, either close the document that is currently open, or rename one of the documents. However mail merge is slow. Macros could be used maliciously to drop malware, download malware, etc. This page shows an example of how to create a mail merge from Word to Excel. First off, go ahead and enable the Developer tab. Also, you can use the DocVariable field to retrieve the value of a document variable after it has been set to display within a Word document. expression. I'm using this library to convert html files into word (Documents. How to Open a Word Document from ACCESS VBA I need help opening a file from a UserForm which has a command button to open a word document. Quit ' close the Word application Set wrdDoc = Nothing. For example, a MS Word document with VBA macros has a storage called "Macros". Close the VBA Editor. Restrict Editing to Parts of a Microsoft Word Document. Re: Closing A Word Document WIth Excel VBA OK looks like I also need to close Word after the document has been closed. I would like to add a “Submit” button on a protected Word 2003 document, so when the user clicks on it his Outlook 2003 opens and sends the document to me as an attachment. Hit the Save. Rather than accessing it via some directory method, such as the FileSystemObject or Shell, try opening it directly via Word Automation. Microsoft Word- Remove the document template reference from many docs it is not a linked document no it is not VBA and has have close to 4,000,000 docs so do. browse to a folder and find all PDF files in that folder), and is not specific to working with Acrobat. Although this text isn't small, the macro we'll create will work on any text we may have copied to the Windows clipboard. VBA FileSystemObject can offer you an object based approach to access your computer’s file system and with this approach you can read, create or delete files and even folders. More often than not, when we are surfing on the Internet, we would like to open multiple web pages at the same time. Although the article was written for VBA for Excel, the concept can also be used in VBA for Word: Excel VBA, Open File Dialog. 7/08/2013В В· VBA Word: How to insert page break in existing Word document. Collaborating in There are two ways to upload files to Google Docs you can click the document title to open the uploaded file or close. You want an easy way to close all open documents and want to quit Word at the same time. Use a Visual Basic for Applications (VBA) script to open secondary Excel workbooks as data sources when opening a VLOOKUP-dependent workbook. Close the dialogs again and save your empty document in the startup folder as “Word Macro-Enabled Template (*. If you only want to use a VBA macro in a specific document, or if you want to be able to send it to someone else, it's a better. Global class, so we can omit the Application property. The one line of code is: ActiveWindow. ExcelVBA で Word オブジェクトを操作 Excel の VBA で、Word オブジェクトを捕まえて、Word ファイルのスタイル一覧を取得するマクロを作ってみました。 ワード文書のスタイル一覧を出力 では、スタイル一覧を、ワード文書に出力しています。. Write Text to Word From Excel using VBA. But, I can click on the "My Documents" folder that is on my desktop and it will show me the same files as if I navigated directly to "D:username". User Forms (including any Excel 5. EXE after merging and printing or emailing. ActiveDocument. At last in the third statement we have used 'Close' method of workbook object to close above specified workbook. A simpler approach is to explicitly run your own Word instance, which you can terminate when finished. The code above is a little less intuitive, so I used the Macro Recorder in VBA to spit out the VBA code for creating a document. We have trained over 90,000 students from over 16,000 organizations on technologies such as Microsoft ASP. Controlling Word from Excel using VBA Posted on June 22, 2017 April 27, 2019 by Excel Off The Grid This post is the second in a series about controlling other applications from Excel using VBA. Original version from November 2002. Five different code procedures (sometimes called Macros) need to be written. Updated January 2014. Copy all tables from a word document to Excel Using VBA Macro to copy all tables from a word document to Excel objdoc. Using Microsoft Excel & Word. This produces the following text in the Word document: Report for Thursday, 8 November 2012. You can easily create a macro (see Example 8-5) to close all the documents except the current one. The Documents is a collection of all the Document objects those are currently open in Word. The best-fitting line is called a regression line. Once located, change the “1” to “0”. How to automatically execute a Word macro when you create, open, or close a document by Susan Harkins in Microsoft Office , in Software on March 17, 2011, 12:57 AM PST. ImportFragment sPath End Sub. When you're working with fields, it's common to need to update all of a document's fields at one time. In order to set or return the zoom and view of a Word document via VBA, you must tell Word which document window you refer to. Jordan, Most of what you want to do can be done in VBA (e. Now locate your new text file. Excel VBA Close Workbook: 8 Ready-To-Use Macro Code Examples To Close Workbooks By J. The problem you're most likely seeing is that, when you close the document running the macro, Word switches the active document. VBA projects are automatically created in Excel when a workbook file is created so you do not have to create one. Use VBA code to display a Word document's built in document properties Description This example shows how to use VBA code to display a Word document's built in document properties. If you’ve looked for examples of using Python and Office, you’ll usually find that the most often hacked component is Excel. COM or ActiveX controls. doc to read document in asp. If you use the following code to open a Word application and a file what code do you use to close the Word application after I have already closed the file? [vba] Set oWord = CreateObject("Word. I'm trying to write a macro that closes the active window without saving the document. For example, a MS Word document with VBA macros has a storage called "Macros". Here is how I would approach this: In You rVBA (e. For each document that is created, it leaves open WINWORD. Step 2: In the Restrict Editing task pane on the right of your screen, under Editing resitrictions, tick Allow only this type of editing in the document:. The Documents is a collection of all the Document objects those are currently open in Word. I have tried lots of solutions from web and none of the early binding approaches would work for me, kept kicking up errors, that I couldn't solve. If you are still new to Word VBA, have a look at the Udemy course "Microsoft Word VBA Macro Programming - Introduction". In Visual Basic, click Module on the Insert menu. Wordを操作する準備VBAは、Excelだけではなく、WordやAccess、PowerPoint、Outlookといった主要なOfficeアプリケーションにも搭載されています。. When you’re done writing a Word document, you just need to do the electronic equivalent of putting it away. Je dois mettre à disposition de mes collègues un document qui ne doit pas etre imprimé, ni copier, ni modifié, ni sauvegardé sous un autre nom. Choose: Insert-Module. Exporting Excel Data Into A Word Document Using VBA If you've been working with Excel for a while, sooner or later you'll need to export data into a Word document for a variety of reasons. For example, select Normal. Close Documents("document. In the Save As dialog right hand side, determine your saving location and provide a meaningful name to your Workbook. To test it, you may simply create a Word document with the following macro. In other words, I can close all applications and return to the document later, click on the embedded objects to open the e-mail messages, and view the attachments to those messages. Il est possible, depuis une application Office, d'en piloter une autre. With VBA, you can do a lot of stuff with a workbook object - such as open a specific workbook, save and close workbooks, create new workbooks, change the workbook properties, etc. Interop Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1. doc to read document in asp. save as and close file macro by zimmertron | October 4, 2006 12:41 PM PDT Need a macro that saves and closes an MS-Word 2003 file with the first line of the document acting as the file name. The problem is that when a word document is closed, the memory doesn't seem to get freed up, so after processing about 2000 documents, I start getting warning messages about system/virtual memory. Although the article was written for VBA for Excel, the concept can also be used in VBA for Word: Excel VBA, Open File Dialog. How to Close a Document in Microsoft Word. We can use the CreateObject() method in VBA to create a new instance of a Word document. Closing a Document Without Saving. SaveAs This Word macro will save the ActiveDocument with a new file name that includes the current time: [crayon-5db9a062db5af620930383/] Create and SaveAs This VBA macro will create a new document and save as using the current date and time: [crayon-5db9a062db5b8305928310/] SaveAs PDF This macro will save the Word document as a PDF: [crayon-5db9a062db5ba173333741/] This…. the Microsoft Office applications. In the Save As dialog right hand side, determine your saving location and provide a meaningful name to your Workbook. How to Open a Word Document from ACCESS VBA I need help opening a file from a UserForm which has a command button to open a word document. The Document Inspector found one or more of the following items that may contain hidden data in your Office document (Word, Excel, or PowerPoint): Macros (including any WordBasic macros in Word documents or Excel 4. I would like to open Word and view the specified document. Create a new blank document in Word. The code above is a little less intuitive, so I used the Macro Recorder in VBA to spit out the VBA code for creating a document. Question: How can I open a particular Microsoft Word document from an Access 2003/XP/2000/97 database?. This MSAccess tutorial explains how to open a Microsoft Word document from within Access 2003 (with step-by-step instructions). This preserves the document as a "templet". I'm trying in the beginning of my macro to close all word application if it's open, although I don't no which documents are open, and I can't set them as an object. This code works to close a PDF document that is open, but how do I kill the Acrobat application or Exit the Acrobat program? "ac. Learn to open and close a file with the VBA Shell command. Find out why Close. VBA-Excel: Change Font, Color, Weight of Table Data in the Word document VBA-Excel: Modified Consolidator - Merge or Combine Multiple Excel Files Into One Where Columns Are Not In Order Send Mail With Link to a Workbook, From MS Outlook using Excel. Then copy and paste below VBA code into the Code window. Close Close all Documents without saving. To do this, create a new class module to register your events. Closes the specified document. Once you have completely written the code, press F5 key. Now locate your new text file. The file will open with full access. Can be one of the WdSaveOptions constants. Close the dialogs again and save your empty document in the startup folder as “Word Macro-Enabled Template (*. I have created several applications that automate email from within the access program using. The code which you can use is -. The closest thing I have found to help me out is a function written on this site called MergeIt(), but when I compile, this line, "Dim objDoc As Word. And that worked, at first, although oWord. How do I open a new WORD document based on a template with macros so that those macros come over to the new document enabling the document to be moved to a different machine without the original template and still have the macros work. I would declare a document object. Create a new blank document in Word. the Microsoft Office applications. NET, Microsoft Office, Azure, Windows, Java, Adobe, Python, SQL, JavaScript, Angular and much more. Dim wdDoc As Object. What does this RGB to Hex converter do? It takes input in the form of values for Red, Green and Blue ranging from 0 to 255 and then converts those values to a hexadecimal string that can be used to specify color in html/css code. Re: Close/Quit Word Application The userform can open up to 25 documents if all are selected. Find out why Close. Placing image in each page of word and convert it in single pdf using vba Dear All, I am new to VBA. As the data in your Excel file changes your word document will change with it. As many of us want to deal with Microsoft Word Document from Excel Macro/VBA. I am just wanting the document to open to the forefront allowing users to view the Manual for assistance when they need it, and let them close the document at their discretion. File is an important part of any computer system. Since you may want to make the code we'll write in this lesson, "How to use VBA Shell," permanent, let's create a new Module to hold the Sub procedures. Close the active document without saving. can you please help me? Thanks & Regds, Raajesh N. You could also refer directly to a specific pane. Visit my website How to create MS Word document automatically with Excel - Duration:. Close End Sub Related examples in the same category. Global class, so we can omit the Application property. Close after ActiveDocument. If you want to print only a portion of the Word document, for example only page 2, then in the. It was part of a legacy Word automation solution that he wasn't in a position to change just yet, and it would crash if there was anything left on the clipboard. Close method. This tutorial is here to teach you the various ways to save, or open existing files in Microsoft Word. When I close the Word document the 'copied' version is still open. The beauty of this method is that you will be taken to the Templates folder (a hidden folder) even if you haven't chosen to display "hidden files, folders, and drives. We have trained over 90,000 students from over 16,000 organizations on technologies such as Microsoft ASP. Also, if I close the document and reopen it,. Hi All I need some help modifying code that I found here and is shown below, which copies entries from tables in Word into Excel. You can also use Word's 'Keep Source Formatting' to paste formatted text into an Item Body. Common Vulnerabilities and Exposures (CVE®) is a list of entries — each containing an identification number, a description, and at least one public reference — for publicly known cybersecurity vulnerabilities. You can double-click in the body of the document. The commands to save all your documents or close them all are still in Word; they are simply buried and you need to add them to the Quick Access Toolbar. Webucator provides instructor-led training to students throughout the US and Canada. Closing a Document Without Saving. Go to you folder and select it. MousePointer = 11. You can also use the Close button. Excel VBA can open existing worksheets and run macros on them. GrabWordFile = word_server. More often than not, when we are surfing on the Internet, we would like to open multiple web pages at the same time. Application. In this article we will be looking at how to export Access data using VBA code, since even a beginner can use the visual interface to export data. Closes the specified document. Specifies whether Word saves changed documents before closing. Once the files are on the same folder, click on “Capture Directory” button. VBA's Select. TextRTF Close #1 oRange. If this document is the first instance of word I have opening: The document opens. As many of us want to deal with Microsoft Word Document from Excel Macro/VBA. Closing a Word 2010 document when you're finished working with it is simple. (Note: If you pick All Documents (Normal. Choose Word Macro Enabled Document as your document type. The VBA code issues 3 prompts: 1. Close objDocument. Using Access VBA creates Word document but unable to close Word Using Microsoft Office 2007, and Windows XP. For this code work you just need to update the oldFilePath and newFilePath variables to meet your requirements. For that, the document template contains a Word VBA - close doc and continue running macro. Close the active document without saving. This takes you into the visual basic editor. Close Documents("document. Hi All I need some help modifying code that I found here and is shown below, which copies entries from tables in Word into Excel. 5000 MB Server space !! 60 GB Traffic/Month !! Php dynamic pages Perl/cgi scripts MySQL databases Password protected folders Advanced log file stats. Also, if I close the document and reopen it,. Closes Each Document Sub Dim doc As Document For Each doc In Documents doc. Saving embedded message object in a Word document using VBA. In Previous Article we saw how to Copy Content from a Word Document and Paste in in to the Active Workbook. the Office Interop. If the document was locked, you should fine this phrase. The Documents collection object has the Close method. 'Code by Mahipal Padigela 'Open Microsoft Word,then goto Visual Basic Editor(Alt+F11) and Insert a Module 'Paste the following code into code window 'Replace the file paths where necessory to suit yours 'Close VBA Editor and run this Macro from the Word window(Alt+F8) 'Note: Make sure you have a few Section Breaks in your document to test the. It was part of a legacy Word automation solution that he wasn't in a position to change just yet, and it would crash if there was anything left on the clipboard. VBA-Excel: Change Font, Color, Weight of Table Data in the Word document VBA-Excel: Modified Consolidator - Merge or Combine Multiple Excel Files Into One Where Columns Are Not In Order Send Mail With Link to a Workbook, From MS Outlook using Excel. You can do this with a macro very easily. Choose Word Macro Enabled Document as your document type. Quit ' close the Word application Set wrdDoc = Nothing. Close SaveChanges:=wdDoNotSaveChanges. The following VBA code will copy the Contents of RichTextBox to the First Paragraph of the ActiveDocument Private Sub cmdCopyRTFContent_Click() Dim oRange As Word. Close objDocument. Can be one of the WdOriginalFormat constants. Open your Word document. Here is how I would approach this: In You rVBA (e. Close The 6th line closes the document by the Document. This works the same way in Word 2010 and Word 2007. Use VBA code to display a Word document's built in document properties Description This example shows how to use VBA code to display a Word document's built in document properties. Save a document: 7. So he took a recent VBA attack apart, to give you a fascinating insight into the security arms race. In other words, I can close all applications and return to the document later, click on the embedded objects to open the e-mail messages, and view the attachments to those messages. How to Open a Word Document From Excel Using VBA by Jeff Grundy \Documents\MyNewWordDoc. I am just wanting the document to open to the forefront allowing users to view the Manual for assistance when they need it, and let them close the document at their discretion. Word VBA - Close button disable problem (self. « A » Array, ReDim an Array: ReDim arrArrayName(intNumberNames) Array, Sort an Array: WordBasic. VBScript/VBS/VBA split single word document to multi-documents by pages - msoWord_SplitPages. expression. On Error Resume Next. Welcome to the p2p. Application. Open an Existing Document: 4. How to use Word VBA to Find Wild Card Matches in Multiple Word Documents and Extract them There are many situations where a particular format throughout the document that needs to be extracted. Open a new Word document and press ALT + F11 to open the Editor, a. Pasting the VBA code example here allows you to save your MS Word document with its native *. Similarly, you might open an existing document, make some temporary changes, and then close the document without saving those changes. ImportFragment sPath End Sub. To leave the last-opened document active, you could try:. Exporting Excel Data Into A Word Document Using VBA If you've been working with Excel for a while, sooner or later you'll need to export data into a Word document for a variety of reasons. It’s even worse in PowerPoint. You can use VBA to program Word all kinds of things that are not possible to achieve by just using Word's built-in menu functions. This preserves the document as a "templet". Zoom and View in VBA operates on the View of document windows. Can be one of the following WdOriginalFormat constants: wdOriginalDocumentFormat, wdPromptUser, or wdWordDocument. You want an easy way to close all open documents and want to quit Word at the same time. It's even worse in PowerPoint. After the document is open I can go View - Print Layout but others will be using the template so I would like it to open automatically in the Print Layout view. I would like to open Word and view the specified document.