How to add AI Based Text Completion in MS Word using ChatGPT

0 Comments
Editor Ratings:
User Ratings:
[Total: 2 Average: 5]




Just by clicking one time you can now use ChatGPT’s natural language capabilities in Microsoft Word. All that you are required to do is type the text to send to ChatGPT anywhere in Microsoft Word and the go to the AI Assistant tab and press the ChatGPT Text Completion button. After a few seconds you will be able to see the results under the original text in Word.

In this article we will be explaining the steps to add AI-based Text Completion functionality to Microsoft Word using ChatGPT. The procedure to add the ChatGPT button in Microsoft Word into 4 basic steps that are outlined in detail below.

Step 1: Enable the Developer Tab

On the ‘File’ tab, choose ‘Option’ and then select ‘Customize Ribbon’. In the ‘Customize the Ribbon’, enable the ‘Developer’ checkbox within the ‘Main Tabs’ category.

Enable Developer tab

Step 2: Import the VBA script file

1. Click on this link and download Source Code (zip) from the GitHub repository. Unzip the contents of the Zip file and locate the ChatgptTextCompletion.bas file in the ‘add-chatgpt-to-microsoft-word-0.1.4\src\windows’ folder. You will need this location later.

2. Next, click on the ‘Developer’ that you enabled in the previous step and then click on the ‘Visual Basic’ button.

Developer - Visual Basic

3. Ensure that ‘Normal’ is selected in the left-side panel and then click on File | Import File.

4. Select the ChatgptTextCompletion.bas file from location and click ‘Open’

Import VBA file

5. Now, click on File | Save Normal and close the current window.

Step 3: Create the ChatGPT button in the Microsoft Word Ribbon

1. Click on the ‘File’ tab and then choose Options > Customize Ribbon.

2. Click on the ‘New Tab’ button and the New tab has to be renamed to AI Assistant.

3. Observe that a ‘New Group (Custom)’ will automatically be created under the New Tab. Rename it to ChatGPT.

Create new tab

4. Next, ensure that ChatGPT (Custom) is selected and choose ‘Macros’ in the ‘Choose Commands from’ dropdown box at the top left.

Add Macro

5. Choose the ‘ChatgptTextCompletion’ Macro and click ‘Add’. Rename the button to ‘ChatGPT Text Completion’, select a Symbol and click on the ‘Ok’ button.

Rename Macro

Step 4: Add your OpenAI APIKey into Windows

1. Type ‘environment variables’ in your Start Menu and choose ‘Edit the system environment variables’ from the results.

2. Click on the ‘Advanced’ tab and then click on the button ‘Environment variables’.

3. Under ‘User Variables’ section, click ‘New’ to create a new user variable. Type OPENAI_API_KEY in variable name field, paste your Open AI API key in the variable value field and click on ‘Ok’.

New environment variable

4. To apply the new environment variable ensure that you restart Windows.

Using the ChatGPT text completion functionality

1. Type your text prompt that you wish to send to ChatGPT anywhere in Word.

Ask Question

2. Click the ‘AI Assistant’ tab and then click on the ‘ChatGPT Text Completion’ button.

3. Wait for some time while ChatGPT generates the response below the original text in Word.

ChatGPT response in Word

ChatGPT response in Word

Closing Comments:

As you have read above, you can easily to add ChatGPT Text Completion functionality in MS Word by using the VBA script file.

Editor Ratings:
User Ratings:
[Total: 2 Average: 5]
Free/Paid: Free

Leave A Reply

 

Get 100 GB FREE

Provide details to get this offer