https://github.com/jddev273/chatgpt-word-macro
A simple Microsoft Word Macro allowing you to use ChatGTP within word through the ChatGTP API.
https://github.com/jddev273/chatgpt-word-macro
chatgpt gpt-3 macro macros microsoft ms openai word
Last synced: about 1 year ago
JSON representation
A simple Microsoft Word Macro allowing you to use ChatGTP within word through the ChatGTP API.
- Host: GitHub
- URL: https://github.com/jddev273/chatgpt-word-macro
- Owner: jddev273
- License: mit
- Created: 2023-03-06T07:15:37.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T23:17:16.000Z (over 3 years ago)
- Last Synced: 2025-02-28T16:11:02.326Z (over 1 year ago)
- Topics: chatgpt, gpt-3, macro, macros, microsoft, ms, openai, word
- Language: VBA
- Homepage:
- Size: 1.08 MB
- Stars: 16
- Watchers: 1
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# ChatGPT Word Macro
A simple macro for communicating with the OpenAI ChatGPT API in Microsoft Word. This was tested under the latest version of Microsoft Word. Adjustments may be needed to run with older versions.
## Demo

## Usage
These instructions may only apply to recent versions of Microsoft Windows. You will need
1. Open Microsoft Word and Click View Then Macros (or Alt-F8).
2. Enter a name (should be ChatGPT or you will need to change the macro code), make sure normal.dotm is selected in the Macros In pulldown menu then click Create.
3. The editor will open up, replace everything with the code in the macro.vba file.
4. Replace `sk-YOUR-CHATGPT-KEY-HERE` with your own OpenAI API key.
5. Run the `ChatGPT` subroutine by pressing Alt-F8 and clicking run.
6. Enter the prompt you want to send to the ChatGPT API in the input box that appears.
7. The response from the ChatGPT API will be inserted into the document where the cursor was last placed.
## Troubleshooting
If you receive an error related to `WinHttp.WinHttpRequest.5.1`, it means that the `WinHttp` library is not registered on your computer. To resolve this issue, you can try re-registering the library by running the following command in an elevated command prompt:
regsvr32 %systemroot%\system32\winhttp.dll
If the error persists, you may need to reinstall the library. You can download it from the Microsoft website.
## Note
The UnescapeString function is used to format the response from the API into a human-readable format. If you encounter any errors or unexpected output, please refer to the comments in the code for further assistance.
## Disclaimer
The authors and contributors of this program provide it as-is, without any warranties or guarantees. They cannot be held responsible for any damages resulting from the use of this program.
## License
This program is licensed under the MIT license.
## Author
Johann Dowa