Skip to content

Create beautiful and unique images in Microsoft Word using ChatGPT's Image Generation Module

License

Notifications You must be signed in to change notification settings

rossarmstrong/chatgpt-create-images-in-microsoft-word

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT - Create images in Microsoft Word

How to add ChatGPT's Image Generation capability to Microsoft Word

Awesome   Windows   Microsoft Word   CI   MIT license   Lifecycle:Stable     

1. Description

With the click of a single button you can access ChatGPT's awesome capabilies to generate unique images in Microsoft Word

create-images-in-microsoft-word-with-chatgpt-image-generator.mp4

2. Getting Started

2.1 Dependencies


2.2 Download Folder for Images

All images created will be saved to the following default folder in Windows 10/11

C:\Users\Public\Pictures



3. Instructions

  • Write a desciption of the image you want ChatGPT to create anywhere in Microsoft Word
  • Click the Image Generation button in the AI Assistant tab
  • Wait a few seconds for ChatGPT to respond
  • The bespoke image will appear under the initial text descrption

3.1 Image Generation Example 1

User Input

Watercolor painting house on the water with trees

ChatGPT Output


3.2 Image Generation Example 2

User Input

An astronaut riding a horse in a photorealistic style

ChatGPT Output


3.3 Top 10 Image Creation Ideas

If you are stuck for inspiration try one of these creation prompts:

1. Oil painting mountains and trees
2. Watercolor house by the water
3. Pointillism landscape
4. Futuristic cars
5. Mona Lisa laughing
6. An astronaut riding a horse in a photorealistic style
7. Fantasy artwork
8. Alien riding an elephant in space holding a phone
9. Painting of a kangaroo cartoon style
10. Bowl of Fruit, Violin and Bottle cubism style

4. Installation

There are 4 basic steps in order to add a ChatGPT button into Microsoft Word:

  1. Enable the Developer Tab
  2. Import the VBA script file
  3. Create the Image Generation button
  4. Add your OpenAI APIKey

Each of these steps are fully outlined below.

4.1 Enable the Developer Tab

The Developer tab isn't displayed by default, but you can add it to the ribbon.

Step 1 - On the File tab, go to Options > Customize Ribbon.

Step 2 - Under Customize the Ribbon and under Main Tabs, select the Developer check box.


The latest instructions to enable the Developer Tab from Microsoft can be found here: https://support.microsoft.com/en-us/office/show-the-developer-tab-in-word-e356706f-1891-4bb8-8d72-f57a51146792

4.2 Import the ChatgptImageGeneration.bas file

Step 1 - Download and Save the latest ChatgptImageGeneration.bas file from this repository.

Keep the location of where the file is saved as you will need it later.

Step 2 - On the Developer tab, click the Visual Basic button.


Step 3 - On the File tab, go to Import File...


Step 4 - Select the ChatgptImageGeneration.bas file and click Open

4.3 Add your ChatGPT button into the Microsoft Word Ribbon

Please Note: This project closely relates to our Add ChatGPT to Microsoft Word project found here: https://github.com/analyticsinmotion/add-chatgpt-to-microsoft-word. If you have have already added that project into Microsoft Word you can start at Step 4 of this section.

Step 1 - Add a new tab (OPTIONAL)

  • On the File tab, go to Options > Customize Ribbon
  • Click New Tab


Step 2 - Rename the New Tab to AI Assistant (OPTIONAL)


Step 3 - Rename New Group (Custom) to ChatGPT (OPTIONAL)


Step 4 - Select Macros in the Choose Commands from dropdown box


Step 5 - Select the ChatgptImageGeneration Macro and click Add >>


Step 6 - Rename button to Image Generation, select a Symbol and click OK


After the preceding steps have been completed the Microsoft Word screen should look like the following:


4.4 Add your OpenAI APIKey into Windows

Step 1 - Open the Start menu and start typing "environment variables". When the best match appears click "Edit the system environment variables" result.


Step 2 - Click the "Environment variables" button under the "Advanced" tab.


Step 3 - Create a new user variable by clicking "New" under the "User Variables" section.


Step 4 - Type the variable name OPENAI_API_KEY in the first field and your OpenAI APIKEY in the variable value field. Then click OK.


Step 5 - IMPORTANT You must restart Windows to apply the new environment variable

5. Best Practices for API Key Safety

Your OpenAI APIKEY key/s should be kept secure and private at all times.

Please follow the best practices guide for API security from OpenAI
https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety

About

Create beautiful and unique images in Microsoft Word using ChatGPT's Image Generation Module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • VBA 100.0%