Vbs Open Word File

Vbs Open Word File 4,1/5 5907 votes

How to open a specific Word document through Excel?

Open an Existing Word Document from Excel using VBA. You can open an existing DOC file (a word document), using the above methods. Instead of using documents.Add method, you’ll have to use documents.Open method. Simply tell the method, which file to open (give it a filename).

This article is talking about opening a specific Word document through Excel.

Office Tab Enable Tabbed Editing and Browsing in Office, and Make Your Work Much Easier..
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
  • Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
  • More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
  • Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
  • Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
  • Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
  • Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment..
  • More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.

Open a specific Word document through Excel with VBA code

Amazing! Using Efficient Tabs in Excel Like Chrome, Firefox and Safari!
Save 50% of your time, and reduce thousands of mouse clicks for you every day!

To open a specific Word document through Excel, please do as follows.

1. In Excel workbook, press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.

2. In the Microsoft Visual Basic for Applications window, please click Insert > Module. Then copy and paste below VBA code into the Code window.

VBA code: Open a specific Word document through Excel

Note: In the code, please change C:UsersDT168DesktopKTWtest.docx to the path of the document you need to open automatically in Excel.

3. Press the F5 key or click the Run button to run the code.

Just cause 2 highly compressed 25mb. Then the specified Word document will be opened automatically.

The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

Free download pahari songs of karnail rana. For most cases, you are often using VBA code to do various tasks in Your Word. However, do you really get hang of the steps to run VBA code? Therefore, in this article, we offer a detailed description of those steps for you.

In the followings, we take Word 2010 as an example to show the detailed steps. And you can easily apply the method to other versions in a similar way.

Step 1 Open the “Developer”

  1. First of all, go to the “File”, and click “Options”.
  2. Next click “Customize Ribbon” to check whether the “Developer” is selected.

If checked, you can go to the Step 2; if not, you need do the followings:

(1). On the right sections of Word Options, you need choose “Main Tabs” under the “Customize Ribbon”.

(2). Now you will find the “Developer”, and then check it.

(3). Finally, click “OK” to close the window.

(4). Back to the home screen of your word, you can easily find the “Developer” tab.

Vbs

Step 2 Check Securities for the Macro

Before running VBA code, you need follow this step to check whether the operating environment is secure to run your macro.

  1. After enabling the “Developer”, you need click “Macro Security” in the “Code” group.
  2. Then make sure the “Disable all macro with notifications” is checked in “Macro Setting”.

Step 3 Edit the VBA code

  1. Firstly, click “Visual Basic” in the “Code” group, on “Developer” tab or you can press “Alt” + “F11” in your keyboard to open the VBA editor.
  2. Then click “Insert”, in the drop-down menu, you can click “Module”.
  3. Next double click to open a new module.
  4. Finally, in the empty area of this project, you can edit your VBA code in it.

Step 4 Run VBA code

After editing the VBA code you need, next comes to run it.

  1. Chick “Run” (the green triangle like bellowed picture) in the toolbar or hit “F5” in your keyboard in the current module.

Alternative Option: Add Macro Buttons to the Quick Access Toolbar

When finishing above steps, you can also add shortcut button for your macro.

  1. Similarly, click “Options” in the “File” tab, and then click “Quick Access Toolbar”.
  2. Choose “Macros” and click “Add” to the toolbar after selecting “All Commands” from the “Choose commands from” drop down list.
  3. Then click “Ok” to close the window.
  4. Back to the document, you can find the macro is already in the Quick Access Toolbar. Therefore, you can easily click it to run your code.

Author Introduction:

Micky Ao is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including Excel fix and pdf repair software products. For more information visit www.datanumen.com