Generate Word Document From Excel Macro

Last week we looked at linking Excel directly to Word documents. Whenever I run the code, it changes the format of everything in the document to whatever I set the current font to be. Below we will look at a program in Excel VBA that reads data from a text file. I got that. Get the Column Number of the selection. How to Save a document/ActiveDocument in Word VBA? ActiveDocument. This tutorial works in conjunction with Outlook, but all the macros are actually entered in Excel. I have slightly modified the code to make it a bit more readable, at least for me, coming from the Excel VBA world. ” Of course, I don’t know anything that JWalk doesn’t already know, so I really had to wrack my brain. The best solution so far is concatenating various cells in the sheet and copying the concatenated cell as simple text to Word, by letting the Open Event trigger the code. Navigate to the folder location on your computer in which your Word document is saved to find the PDF version of the file. Select the rectangle shape1 then double-click the object with selection mode. click the SaveWithName macro in the left pane, and click the Add button 7. Launch Microsoft Excel and click the Developer tab. Likewise, in Word you would want to use ActiveDocument instead of ThisDocument. Using the Word Macro Recorder is again, similar to the Excel Macro recorder. use the “ Tools ” menu > “ Macro ” menu item > Security item > then set the security level to “ Medium :” > then click “ OK ” to return to the document quit out of Word by using the File menu > Exit out of Word. There are two main issues with saving files: where to save it (which isn't a problem with a macro because you can always write code to make sure the file gets saved in the right place), but more importantly, what to call it. Control Excel from Word using VBA in Microsoft Excel 2010. Finish with a message to the user. To insert tables, format text etc. doc" If Dir(LWordDoc) = "" Then MsgBox "Document not found. Kutools for Excel , with more than 300 handy functions, makes your jobs more easier. To create a new document, simply include this line in your VBA macro: Documents. Reproducing the Excel formatting in the Word document can be tedious and will most likely need to be updated when you refresh the file There are articles showing how to push data from Excel to Word using VBA, [see the following], but I hadn’t come across any that used Word as the driver when I had a recent need to do this. [!] The idea is to generate your malicious document on a development box you OWN and use that document to send to a target. This example shows how to create a Word document with some formatting in Visual Basic. 4 part section >> A TreeView Project. As an example, VBA code written in Microsoft Access can establish references to the Excel, Word and Outlook libraries; this allows creating an application that --- for instance --- runs a query in Access, exports the results to Excel and analyzes them, and then formats the output as tables in a Word document or sends them as an Outlook email. One tried to use macros and the other resorted to cut and paste. Hi All, I am new to this forum and need some urgent help we need to prepare a VBA macro solution that uses an excel file to generate a pre formatted word document for each row of data in excel file. Open your Word, Excel, or PowerPoint document, if it's not already open. Yes, I have saved it as. Before you run this macro, you have to add a VBA reference to the Word object library in Excel's VB editor. Create automated Word documents with self generated comments using. The CHDIR function is a built-in function in Excel that is categorized as a File/Directory Function. Insert Excel file as an attachment. Like so: 1. The File tab replaces the Office button from Word 2007. This script will temporarily disable 2 macro security settings while creating the document. For that we will define the path within quotes right after the keyword. lnk file) from inside your VBA (Visual Basic for Application) enabled application, e. Split a MS word document at Section Breaks into individual documents using word VBA. These two macros will save you a lot of time. Re: Create word/excel document in c# with HTML Formatting May 09, 2014 08:08 AM | mhamidnasir | LINK I am creating word file using html page binded to database everything is fine but i want to add footer image in. When someone clicks the button, the macro opens the editor, ready to add a new page, and adds content to the page based on the given template. Lets see how this is done. files that MS Excel can load in and properly place within columns and rows) include dbase (*. This tutorial works in conjunction with Outlook, but all the macros are actually entered in Excel. Inspired by a recent course question (thanks, Jen) I thought I'd share my thoughts on how to create a chart, add a textbox to it and copy the whole caboodle to Word - all using VBA. Many a times, you have to copy data from an excel file to a word document. In Excel 2016 for Mac, you can create a macro that has a keyboard shortcut, run a macro, and delete a macro that you no longer need. DESCRIPTION This script will generate malicious Microsoft Excel Documents that contain VBA macros. You may also want to read: Export Excel to PDF. application"). txtformfile )! Microsoft Word - Creating an Excel document to auto. What you want to do is called Mail Merge. Also please visit my website www. docx; It processes all actual MS Word tables, not pictures that might look like tables. If you have ever needed to open a Word document and are looking for an alternative method to the Application. The Select File window opens. Lets see how this is done. 'Mail Merge. Step 3 Assign a macro for objects. It continues to work, well, in Word 2019. To save a VBA project and its modules, you save the workbook file that contains them. You can create a button on the Quick Access Toolbar that will invoke the macro as follows: 1. Navigate to the folder location on your computer in which your Word document is saved to find the PDF version of the file. Learn VBA to Become an Expert at Creating Excel Macros While you may want to start with simple examples, macros can get incredibly complex. The problem comes when we want to change the file path of the linked document, as it is necessary to change the links one by one. Then copy and paste below VBA code into the Code window. But I can only get the top row of data and the bottom row of each page of the label to display the excel list data. dbf), comma delineated (these are text files with the column values separated by commas and the row values separated by returns), as well as importable files from other spreadsheet. A macro in my Word template adds an invoice # and saves the document as a text file. About this tutorial: Video duration: 12:18 In this lesson, we learn how to add text to a Word document using microsoft excel! Check it out! Excel to MS Word pt1: Excel to MS Word pt2: Excel to MS Word pt3: Part 2 of this Lesson here: New Contest!. Select Excel Macro-Enabled Workbook. I just don’t seem to be able to see the chart (pivot or not) when I try to link or insert a chart into Word document. Get more than 100 ready-to-use scripts, or use the samples as a template for your own programming. It continues to work, well, in Word 2019. To save a document with a new name, use the SaveAs method: 5. 0 Object Library (or something close). Just open a dummy excel workbook. 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…. I'm trying to make a VBA macro to create a Word document from Excel Currently I'm having issues with setting up the Lists properly. Visual Basic for Applications (VBA), Microsoft's scripting language for Excel and Word, lets users of these programs write scripts that speed up common tasks like accessing table data. A drop-down list is a very handy Excel tool for checking the entered data. Cell B1 will contain the path of the Word document. The code below will display an open file dialog and ask the user to select the path of the file to open. This file contains some geographical coordinates we want to import into Excel. Answer: From your Access database, you can open any Word document that you wish. Re: Create word/excel document in c# with HTML Formatting May 09, 2014 08:08 AM | mhamidnasir | LINK I am creating word file using html page binded to database everything is fine but i want to add footer image in. In the coming Save As dialog box, enter a name for this workbook in the File name box, and click the Save as type box and select Excel Macro-Enabled Template (*. Quickly create folders based on cell values with Kutools for Excel It is easy and convenient for you to create folders based on cell vales if you use the tool- Kutools for Excel. Pros & Cons for Each Method. After you turn off the recorder, you can replay the recorded macro to repeat the exact sequence. Let’s start by creating a new macro in VBA for opening excel file, by using the Sub keyword and naming the macro Open Workbook. The conversion options that you can set in the following steps are some of the most commonly used settings from the Acrobat PDFMaker dialog box. Rather than opening Excel file every time and clicking the button,I want to create a macro in outlook mail which on clicking generate this email. This article shows you how to export the data directly into Word using some easy to understand VBA code. Combine / import / copy / merge Excel workbooks into a single workbook using VBA programatically. You can record your actions to automatically create a macro in some programs, or you can use Visual Basic coding. Last week we looked at linking Excel directly to Word documents. In the Name of new Document type the name of your new file and select the directory by click Change button. 2) Select Blank Document, if necessary / under Create New, click Template / click OK. This script will temporarily disable 2 macro security settings while creating the document. This week two people approached me with a similar problem. - when creating the library). I am working with Excel 2013 trying to add a macro to print too but it's not working. I've come up with various solutions, but each solution has it's problem. Also, enable "Trust access to the VBA project object model" which is under Developer Macro Settings. Here we typed Word File. There are some very useful libaries that are not part of Excel VBA. These include the Dictionary, Database objects, Outlook VBA objects, Word VBA objects and so on. Save the document as a Microsoft Office file type. How to create a new document in Word VBA? Documents. A Sub(short for Subroutine) is simply a collection of lines of VBA code that perform certain tasks. The sample uses a static text file for the code module that is inserted into Excel. The first way is called Early Binding and you should use this method if you only plan to use the script yourself. This is the first article which opens a Word Document and read the whole content of that Word Document and put it in the Active Worksheet in a particular Cell. As many of us want to deal with Microsoft Word Document from Excel Macro/VBA. Click the 'File Name' text box and type a new name for the duplicate file. Excel VBA, Open File Dialog; Although the article was written for excel, the concept can be used in VBA for Word too. After writing these commands, through the use of !DDE_FLUSH , the Excel Macro can be executed in the same DATA Step as it is written. If the macro security was just changed, you may. In some documents, you may use many acronyms (i. Best Answer: Below is an example Excel macro that will launch MS-Word and create a blank Word doc. A way of locking the data down is to create a template in word which is linked to a template in Excel. Enter a name and select a location for your workbook. 0 Object Library (or something close). Save spreadsheets in OneDrive. The macro will open an existing / new excel file, copy the contents and then save and close the file. In Excel workbook, press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window. Step 3: Select the "startDecipher" macro and select "Run". Here I have crafted a payload for VBA which can be embedded into Office Document and once a victim opens a malicious DOCX file, reverse connection should connect back to attacker machine to access and control victim workstation on port 443. Set wdApp = CreateObject("Word. vcf File) Reader with Excel VBA Have you ever wanted to import contact details from VCF data in to an Excel sheet? Follow this article and create your own VCF reader that would import data from your VCF files into Excel worksheets. This can create significant time saving as the Word document updates automatically whenever the Excel file changes. The macros on this page will list all the files or subfolders in a specific folder. You may sometimes want or need to create an Excel workbook in an automated way. Creating Office Automation macros is a bit more complex than creating a macro that will work solely within a specific application, such as Excel. The file she has will have 300 rows therefore I will need to create 300 word docs, each saved with the name from Column A (this is the customer name) After creating the Word Document, I need to create a hyperlink for it into Column B. Step 4 – Run the Macro. MTB) select the following function in Minitab: File>Other Files>Run an Exec. You will see an "Options…" button appear. Write with confidence, knowing intelligent technology can help with spelling, grammar and even stylistic writing suggestions. Click on: Developer -> Record Macro For the example in this post, we will create a macro which will open a new Word document, then copy a chart from Excel and paste it into that Word document. Looks like not too complex task. Let's say you have data in Excel file, and you want to create multiple Word documents from that, each individualized based on data from Excel, then this tutorial will help you do that. Then select Object. 1 - Creating. The easiest way to create a macro in Word 2007 is to use the macro recorder. Hi,I have created a button in excel which on clicking send an email. Now click on the "Macros drop down list "and choose "Record Macro. In Word, you can automate frequently used tasks by creating and running macros. After writing these commands, through the use of !DDE_FLUSH , the Excel Macro can be executed in the same DATA Step as it is written. Please find enclosed the Excel file and the DOC format that I need. This file contains some geographical coordinates we want to import into Excel. More Information Microsoft provides programming examples for illustration only, without warranty either expressed or implied. When you record a macro, the macro recorder records all the steps required to complete the actions that you want your macro to perform. The MacroButton field is a field developed in early versions of Word (pre-Windows). Basically I want a button in my excel spreadsheet that I can assign a macro to that will open up a word document for each student and populate a MS Word template with data. Save a document: 7. This tutorial will demonstrate how to export multiple sheets of a workbook into a single PDF file using Excel VBA. click the File tab 3. CSV extensions, Microsoft Excel is opened in the Results Viewer. In the previous post, I demonstrated how to export Excel to PDF, which is very easy because there is already a built in function to do that (using Save As and choose PDF). However, I want to use a Word Template and fill in the data at specific location. Word would directly go to the Custom Office Templates folder. These steps can include typing text or numbers, clicking cells or commands on the ribbon or on menus,. To open a specific Word document through Excel, please do as follows. You can record your actions to automatically create a macro in some programs, or you can use Visual Basic coding. , I would need to know specifics. Complete To, CC & Subject fields. Any VBA application you create is a essentially collection of Subs. NET and Automating Word Edraw office viewer component is an easy and reliable solution for the developers to Embed Microsoft Word documents in a vb. This macro will allow you to be more specific as to what sheets are exported. [!] The idea is to generate your malicious document on a development box you OWN and use that document to send to a target. The goal is to insert data into the template creating a specific purchase agreement. We can deal with Other MS Office Applications (Word, PowerPoint,Access). PDF / File > Print > Adobe PDF) Choose target folder & save. Also please visit my website www. You may also want to read: Export Excel to PDF. i have an excel workbook that has numerous named ranges. To save a document with a new name, use the SaveAs method: 5. Right-click the shape1 to choose the Assign macro. This is a small but cool macro; you can attach it to a button or checkbox and then, whenever a user clicks the button or checkbox, have a specified Microsoft word document open. I'm able to create a word application and open a new document and start filling in the data. Yes, I have saved it as. Follow Ty Anderson on Google+ , Facebook. With Excel VBA you can create a folder in a specific directory to save your file or files to. The VBA code in this article runs against an open Office application where many of the objects that the code manipulates are already up and running; for example, the Application itself, the Worksheet in Excel, the Document in Word, the Presentation in PowerPoint, the Explorer and Folder objects in Outlook. VBA can do most of the work for you. Add a word document: 2. You can use the following code to create new Workbook and save in the C drive using Add method. XlsxWriter is a Python module that can be used to write text, numbers, formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file. 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. The following macro copies a range of cells from the active sheet and pastes the data into a new workbook. The CHDIR function is a built-in function in Excel that is categorized as a File/Directory Function. Lets see how this is done. Importing content from Word documents. If your source document is a 'doc', not 'docx', change that part of the first 'Set wdDoc' line also. Updated January 2014. I have a small macro for this purpose but the problem is that the code opens my file with Word , instead of Notepad. VBA is simple to use and automates routine tasks especially in Microsoft Excel. You may also want to read: Export Excel to PDF. to create a Word document. Excel provides the option of recording macros whereby your keystrokes are saved and can then be replayed. There are times we have to copy data from a word document to an excel file. This macro will allow you to be more specific as to what sheets are exported. Create or Solve Sudoku Puzzles in Excel Create Validation Routines in Access 2000 (Article) create, edit and save a word document Create, Edit, Save, and Close Word Documents Credit Card & SIN Number Validation Dbl Linked List In VB Detect when MS Word Has Quit After Starting an Instance of Word Application Object Download Web Page Hyperlinks. Check the display as icon. Now we will use the Workbooks. I have written quite a lot of VBA for Excel but this would be my first foray into its use in Word. VBA Word - Como criar um documento PDF a partir do MS Word - How to Create PDF from Word Document using VBA VBA Excel - Tornando tudo maiúsculo, minúsculo. Now click on the "Macros drop down list "and choose "Record Macro. Generating Word 2000 data from an Excel VBA program: 8. Data from the report is inserted into different cells of the table. In this lesson, you'll learn how to write data from a spreadsheet to a text file. To get started connecting Word to Excel, you'll need to make sure you can reference the latter in VBA The Excel VBA Programming Tutorial for Beginners The Excel VBA Programming Tutorial for Beginners VBA is a Microsoft Office power tool. the Microsoft Office applications. The macro will open an existing / new excel file, copy the contents and then save and close the file. Preferably, something I don't already know. Start a macro recorder, go to: File / Save as. The macros on this page will list all the files or subfolders in a specific folder. Please find enclosed the Excel file and the DOC format that I need. 2: Running the Word to Excel Conversion Macro. Add ActiveX reference for Bytescout Barcode SDK. Open Word Document This Word VBA Macro will open a word document from the specified directory: [crayon-5db685611946c937100686/] Now you can interact with the newly opened document with the ActiveDocument Object. To create a new document that uses a specific template, use this: 3. This tutorial works in conjunction with Outlook, but all the macros are actually entered in Excel. 29, 2012, under Access Another method for outputting an Access Report to PDF is to create a Macro to do it automatically, whenever the Macro is called. net application. Open you Word document and click on the "View Tab". Add Method in workbook1. Specify how much of the workbook to convert and the final page size, and then click Convert to PDF. Get all the information you need as you write without leaving Word. We can deal with Other MS Office Applications (Word, PowerPoint,Access). Creating a catalog for a workbook with many worksheets is necessary. Gomez Without any doubt, one of the most basic and common operations in Excel is opening a workbook. Select the Create from file and browse to your excel document which has to be inserted. Write with confidence, knowing intelligent technology can help with spelling, grammar and even stylistic writing suggestions. Rather than opening Excel file every time and clicking the button,I want to create a macro in outlook mail which on clicking generate this email. Automating Word Functions with Excel VBA Code Since most users install the full Microsoft Office suite of tools, they have Word and Excel installed on the same computer. The following sample demonstrates inserting a code module into Microsoft Excel, but you can use the same technique for Word and PowerPoint because both incorporate the same VBA engine. You may also want to read: Export Excel to PDF. You can choose to preserve or delete VBA macros. Also while pasting in the word Document you can format the Doc as per your requirement. The macro will open a new / existing word doc, copy the contents and then save and close the word doc. I have written quite a lot of VBA for Excel but this would be my first foray into its use in Word. Hit Insert. I can add the macro in VBA but it's like I can't get the two to talk to each other. i am unsure create a word document from excel vba. OBA success stories at microsoft. When viewing the page, people will see the content of the document, without needing to have Office installed. This tutorial covers macros in Word 2003. If the macro security was just changed, you may. Excel VBA Introduction Part 27. Microsoft Office documents — Word, Excel, PowerPoint, and other types of documents — can contain embedded code written in a programming language known as Visual Basic for Applications (VBA). Change the ‘Save as’ folder foe excel files: We can set a directory as the default location for saving excel files. I'm using Office 2013 and want to modify a Word Document template from an Excel VBA module. In Excel workbook, press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window. Save a document: 7. Yes, you can but there are two different ways of implementing this. I need in XL for a macro to run, open my word file, copy the entire thing and then paste it back in XL. The code below will display an open file dialog and ask the user to select the path of the file to open. The MacroButton field is a field developed in early versions of Word (pre-Windows). Add ActiveX reference for Bytescout Barcode SDK. Dim oWord As Object ' DECLARE OBJECT Set oWord = CreateObject(Class:="Word. In this post we're going to explore how to go about getting a list of file names in a folder without using any VBA code. 'Mail Merge. Saving to PDF (and then to an image format) is an…. More specifically my d: drive contains. Create Multiple Word Docs from Excel Data Good Morning/Afternoon/Night, I'm looking to create a macro that will take data from Excel, copy it into a Word document (I have a template already made up), and then save the word document. We can deal with Other MS Office Applications (Word, PowerPoint,Access). Now, you can open any Word doc and run the MergeDocs macro. So I've tried to teach myself VBA to record macros that will take information from an excel spreadsheet and populate it in a corresponding bookmark in MS Word but no luck. Let's talk Office 2010. Dim wdDoc As Object. 4 part section >> A TreeView Project. They were trying to get a simple, but long address list from Microsoft Word into Microsoft Excel. I've come up with various solutions, but each solution has it's problem. Change the ‘Save as’ folder foe excel files: We can set a directory as the default location for saving excel files. When you record a macro, the macro recorder records all the steps required to complete the actions that you want your macro to perform. First attach the document to a Confluence page, then use the macro to display the content. Convert Word to PDF using VBA. In Visual Basic, you create an XMLHttpRequest object to connect to an external server which can be replaced with URLFetch in Apps Script. Then, click a button on the same worksheet, to run a macro that creates the list. For that we will define the path within quotes right after the keyword. In fact, since I have never written a line of Word Macro code before, I went to Word, recorded the actions, then copied that code into Excel, adding the prefix before each line. Sub Convert_2_PDF() ActiveDocument. Step 4: The default settings will be loaded in the Word to Excel Conversion Macro. Microsoft Excel to Word – VBA Automation Use Cases. If you open the file in your system, it will show your. So you can use these macros every day for your own work you will need to move them into a file that is open every time automatically for you. Perhaps you need to use the data as part of a mail-merge or Word is the preferred application in your workplace. They requested a spreadsheet with the different information. Create New Workbook in Excel VBA - Example Cases: Create new workbook; Create an Object for newly created workbook; Create new workbook. A style represents either a built-in style or a user defined style. If you've got some useful data in an Excel spreadsheet which needs to be saved in a Word document it's tempting to simply copy and paste. I want to make buttons that can be clicked in excel that will enter a large amount of specified text into the word document. The tool was originally created for form letters, hence the name. Open a Word document. what i am trying to do is create a word doc. Save a macro-enabled workbook. Word VBA: Moving Cursor to Beginning of Document by Bookmark; Word VBA: Paste Text Only by PasteSpecial Method; Word VBA: Wrap Type Constants List; Word Macro: Removing Strike-through Formatting; Word VBA: Displaying the Change Case Dialog Box; Word VBA: Selecting All Text by WholeStory; Word VBA: Selecting All Text by the Document. words formed from the initial letters of multi-word names, e. With Excel VBA you can automate tasks in Excel by writing so called macros. Good luck! lizo: 12/12/2008: This macro worked perfectly for me! Thanks so much. Application") ' INITIALIZE THE OBJECT. Create or load in an MS Excel compatible file. Time to Complete by Hand 4 days typically as Documents went through multiple authors. The following VBA code would open a document called "Doc1. Click 'Macros' in the 'Code' group in the 'Developer' tab. As coded, the macro looks for a docx document and saves the output files in that format. Placing image in each page of word and convert it in single pdf using vba Dear All, I am new to VBA. If you use VBA in my experience Excel tended to upload data from Excel into Word a different size and shape each time the code runs. Step 4 - Run the Macro. Click OK to return to your document. Perhaps you need to use the data as part of a mail-merge or Word is the preferred application in your workplace. The best solution so far is concatenating various cells in the sheet and copying the concatenated cell as simple text to Word, by letting the Open Event trigger the code. Add ActiveX reference for Bytescout Barcode SDK. How to Create PDF from Word Document using VBA. Excel insert file object (non-VBA) In Excel, insert file is known as insert object, there are two kinds of insert: Embedded Object – insert the source file into Excel; Linked Object – insert the link of file into Excel, not the actual. dbf), comma delineated (these are text files with the column values separated by commas and the row values separated by returns), as well as importable files from other spreadsheet. ) Posted on Friday, August 30th, 2013 at 6:34 am by Ty Anderson. One of the things you may want to do is to download a free Help file that includes a good deal of information about Office Automation applications. It continues to work, well, in Word 2019. Save a document: 7. I would like the Document to open, have it showing with either macros already enabled or the prompt to enable them. This week two people approached me with a similar problem. Document Dim oResDoc As Word. The following code illustrates this concept: Sub OpenWord() Dim wdApp As Object. Then select Object. Normally, you would do this with Paste Special, but this is several awkward clicks. APIs call, or execute, Window's functions. Microsoft Access VBA Techniques - Susan Dorey Designs code. Perhaps you need to use the data as part of a mail-merge or Word is the preferred application in your workplace. Create an email from a template (with attachments) April 1, 2007 in MS Outlook - Email, Professional Portfolio. How to create a Macro in Word 2013. In this lesson, you'll learn how to write data from a spreadsheet to a text file. QR Code can be converted in all excel cells with just a few clicks and the barcode image can be updated with the linked cell contents. ) or export it to another file such as a Word document or PowerPoint presentation. In this video I show you how to take data from any Excel table, Create Customized Word & PDF Documents, Filter, and Print or Email those document. Create Excel Chart from C# / VB. VBA, Write Excel Values to Word Document If you need assistance with your code, or you are looking for a VBA programmer to hire feel free to contact me. Step 4 - Run the Macro. Click on View tab. You will used them every time when you need to copy something from external source (like Internet page) into a Word or Excel document, but you do not need all the colors and formatting. Another powerful feature of Excel VBA is to interact with Other Applications. I'm looking to create a macro that will take data from Excel, copy it into a Word document (I have a template already made up), and then save the word document. Insert Image to Word, Resize Image, Insert Borders using VBA Excel. Visible = True ' OPEN THE WORD FILE. Example below demonstrates how to: Open a new email template from a saved location. VBA-Excel: Create and Save the Word document. Open an Existing Document: 4. Microsoft Excel to Word – VBA Automation Use Cases.