GPT Chat for Microsoft Word

In this post we will deal with how to integrate chatgpt into Microsoft Word. Chatgpt can increase your productivity and significantly improve your writing skills.

Microsoft Word
Microsoft Word

Those who do not know chatgpt, is a cutting -edge linguistic model that provides responses similar to human ones. He has gained enormous popularity in recent months.

Advantages of the use of chatgpt in ms word

Chatgpt can be used to improve your writing and generate content for you in Microsoft Word (see also how to integrate withExcel and PowerPoint). Discover some ways in which you can use it in Word:

  • Generates a custom -made curriculum for work based on the description of the work
  • Generates content for posts or blog articles
  • Summarize long reports for you
  • Provide suggestions for social media posts
  • Create models by e-mails and proposals
  • Helps non -native speakers to translate into other languages

How to use chatgpt in Microsoft Word

Integrate chatgpt in MS Word has never been so simple with the plug-in chatgpt (additional component). You can download the additional component using the connection below. It is absolutely free and can be performed on all the versions of Office Desktop and Office 365. Furthermore, there are no prerequisites for the use of this additional component.

Get the OpenAI API key

First you have to register by visiting the Openai website using this link:platform.openai.com. Using your accountGoogleO existing Microsoft you can do it easily. The last step is to obtainthe secret API keyTo use the Openi API. Copy your API key for future reference. The API key is similar to the text below

sk-xxxxxxxxx

Is the ChatGPT API free?

The chatgpt plugin for MS Word is completely free and compatible with all versions of MS Word.However, keep in mind that the Openai bees includes applicable costs. These expenses are quite convenient. They are determined on the basis of how much the bees use. If you do not use API at all during a certain month, that period will not be charged to you. For more complete details on prices, it is recommended to refer to the documentation on Openai prices.

Does the chatgpt API use my data?

The privacy policy of Openai data states that the user data sent through their bees are not used to train their models. The inputs and the APIs are maintained separate and are not used in the process of training of the related models. This commitment to data privacy guarantees that user information remain safe and reserved during the use of the API.

Steps to install the additional component

Microsoft blocks the additional external files and says that the origin of this file is not reliable. To make the file reliable, you need to follow the following steps.

  1. Go to the folder where the file of theAdditional component downloaded.
  2. Decomprise the file by clicking with the right mouse button on the zipped file and selectExtract everything.
  3. Click the right mouse buttonon the file and choosePropertyfrom the menu.
  4. At the bottom of theGeneral tab, select the control boxUnlockunder the optionSecurity, then clickOK

To make the additional component available every time MS Word is starting, it is possible to save it in the folderAutomatic execution.Follow the steps below.

  • Go upFile>Options>advanced.
  • Scroll down toGeneraland clickFile locations.
  • ClickStartup>ModificationAnd you will have two options: identify the folder in which the file of the unloaded additional component is archived. Or instead of changing the path of the automatic execution folder, it is also possible to glue the additional component in the existing automatic execution folder.
    We recommend using this last option.If you prefer the first option, be sure to create a new folder and insert the file of the unloaded additional component there, then move to the path of the automatic execution folder in this new folder. It is because if you use a folder, for example the download/documents folder, which can contain so many rows of words, it is likely that MS Word is blocking.

How to use the additional chatgpt component

Follow the following steps to use the additional chatgpt component for MS Word.

  1. Open a new or existing MS Word document
  2. Type the text you want to ask for chatgpt
  3. Select the text you type in the previous step
  4. Click on the tabChat GPT>AI Writer
  5. Enter your API key
  6. The output will be generated and displayed in seconds
  7. The output will be saved in a new Word document in the same folder in which the active Word document is archived
  8. The output file name isoutput_mm-dd-yyyy_hr-min-sec.docx

If your active Word document is not saved in any position, you will be asked to select the folder in which you want to save the output file.

Resume generator

You can generate curriculum with this additional component. It is important to provide a clear and detailed request so that chatgpt generates a curriculum according to your needs. Always be specific and try with more suggestions to get the best result. See some of the examples below:

Write a professional curriculum for a [profile name]. I have [n] years of experience. My titles and previous companies were [title, company name]. I include list points.

Write a professional curriculum for a data scientist. I have 5 years of experience. My past titles and companies were an analyst, Barclays, Team Lead, JP Morgan. I include list points.

Write a curriculum for a [profile name] based on this description of the work. [Add the description of the work here]

Writing emails

You can ask the additional chatgpt component to create a draft email for you. Whether you need to send a formal company e-mail or a friendly message to a colleague or friend, Chatgpt can help you write a professional and well-drawn up message. You just have to provide the purpose of the e-mail and a little context and chatgpt will generate an e-mail well written for you. You can also choose the tone of the e-mail.

Write an email to the manager about tomorrow's disease leave. The name of my manager is Dave. My name is deep.

Write an e-mail to colleague about personal leave tomorrow. The name of my colleague is Joe. My name is deep.The tone should be informal.

It is also good to specify the tone: formal/informal/humorous.

Summary writing

The additional chatgpt component can be used to summarize long Word documents. For example, you have a long document and you are asked to create a summary based on it. It could be boring and expensive in terms of time to read the entire text and then write the summary.

Reassure the following text in List Points - [Paste text here]

How to enable the chronology of conversations?

You can improve the output so that Chatgpt remember the chronology of previous conversations. The chatgpt API does not call the previous conversations by default. Take each API request as a new chat. This means that when he answers your current question, he does not remember your previous question.

To improve the chatgpt experience we have a functionality called "Chat"In the plug-in. Watch the demonstration video below. In this example, we asked Chatgpt to create a curriculum by providing some details at work and previous work experiences. The curriculum was generated accordingly. To improve the CV, we asked chatgpt to add internship experience. If known, he remembered the previous instructions and included only the internship experience while maintaining the rest of the curriculum.

TheResetbutton starts a new chat and removes the chronology of previous conversations. Use this button when you don't need chat chronology to generate output.

How to define the style of the output chatgpt?

You can give a style to the MS Word document by adding the following lines to the end of the prompt you ask for chatgpt

  • It highlights the titles in dark blue color.
    Write a curriculum for a software engineer. It highlights the titles in dark blue color.
  • I include list points.
  • Please format the text in italics.
  • The text should be in red color.

In the next paragraph we will see the source code of this additional component. If you are not interested in knowing the source code, you can skip the next section. The additional component and the VBA code have the same purpose.

The advantage of the use of the additional component is that it opens automatically every time you open a new Word document. While the MS Word Macro file is specific for a particular Word document. You have to open the same macro file every time to access chatgpt. The additional component also performs formatting in the Word document.

VBA code to integrate Chatgpt with MS Word

You can use the VBA code below to perform chatgpt in MS Word. Make sure to change the API key (highlighted below)

Sub Chatgpt () Dim Request AS Object Dim Text As String, Response as string, API AS String, Api_key As String, Displaytext As String, Error_result AS String STARTPOSPPOSE AS LONG, status_code as long dim prompt as string selectdtext as range 'API API API = "https://api.openai.com/v1/cat/complerations" 'bees keyApi_key = "SK-XXXXXXXXXXXXXXXXXXXXXXXXX"

    If api_key = "" Then
        MsgBox "Error: API key is blank!"
        Exit Sub
    End If
    
    ' Prompt the user to select text in the document
    If Selection.Type  wdSelectionIP Then
        prompt = Trim(Selection.text)
        Set selectedText = Selection.Range
    Else
        MsgBox "Please select some text before running this macro."
        Exit Sub
    End If
        
    'Cleaning
    text = Replace(prompt, Chr(34), Chr(39))
    text = Replace(text, vbLf, "")
    text = Replace(text, vbCr, "")
    text = Replace(text, vbCrLf, "")

    ' Remove selection
    Selection.Collapse

    'Create an HTTP request object
    Set request = CreateObject("MSXML2.XMLHTTP")
    With request
        .Open "POST", API, False
        .setRequestHeader "Content-Type", "application/json"
        .setRequestHeader "Authorization", "Bearer " & api_key
        .send "{""model"": ""gpt-3.5-turbo"",  ""messages"": [{""content"":""" & text & """,""role"":""user""}]," _
             & """temperature"": 1, ""top_p"": 0.7}"
      status_code = .Status
      response = .responseText
    End With

    'Extract content
    If status_code = 200 Then
      DisplayText = ExtractContent(response)
                
    'Insert response text into Word document
    selectedText.InsertAfter vbNewLine & DisplayText

        
    Else
        startPos = InStr(response, """message"": """) + Len("""message"": """)
        endPos = InStr(startPos, response, """")
        If startPos > Len("""message"": """) And endPos > startPos Then
            DisplayText = Mid(response, startPos, endPos - startPos)
        Else
            DisplayText = ""
        End If
        
        'Insert error message into Word document
        EDisplayText = "Error : " & DisplayText
        selectedText.InsertAfter vbNewLine & EDisplayText
        
    End If
    
    
    'Clean up the object
    Set request = Nothing

End Sub


Function ExtractContent(jsonString As String) As String
    Dim startPos As Long
    Dim endPos As Long
    Dim Content As String
    
    startPos = InStr(jsonString, """content"": """) + Len("""content"": """)
    endPos = InStr(startPos, jsonString, "},") - 2
    Content = Mid(jsonString, startPos, endPos - startPos)
    Content = Trim(Replace(Content, """", Chr(34)))
        
    Content = Replace(Content, vbCrLf, "")
    Content = Replace(Content, vbLf, "")
    Content = Replace(Content, vbCr, "")
    Content = Replace(Content, "n", vbCrLf)
     
    If Right(Content, 1) = """" Then
      Content = Left(Content, Len(Content) - 1)
    End If
    
    ExtractContent = Content

End Function

How to use VBA code

The following steps provide basic instructions for the use of the VBA code in MS Word.

  1. PressAlt+f11to open the VBA editor.
  2. ClickInsert> ModuleTo create a new form.
  3. In the module, paste the VBA code.
  4. Replace the API keyapi_keywith your actual API key.
  5. Close the VBA editor.
  6. Perform the macro by pressingAlt+F8, then selectChat GPTAnd press the execution button.

If you want to useChatgpt-4, you can replacegpt-3.5-turbowithgpt-4the VBA code above.

How to optimize the chatgpt output

In the additional code/VBA shown above, you will find a temperature parameter. It varies from 0 to 2. By increasing the value, for example 1.2, you will get a more random output, while decreasing the value, like 0.2, will get a more targeted output.

Steps for resolution of errors

Error: You have exceeded the current share, check your plan and billing details: To solve this problem, you will have to switch to a paid account that charges you based on the use of the API. This is not Chatgpt Plus but a paid plan for the use of the API. It is very convenient, it would cost you less than one dollar a month even when you use bees widely every day.

VisitThe Openii website. Access, go to the pageBillingAnd sign up for the "Pay As You Go" plan with your debit or credit card. If you are already using this plan, this error indicates that you are sending a high volume of requests to chatgpt, which is unable to manage. It is also possible that your limit has been set too low. You can check your current share in your account settings.

ErrorThe model: gpt-4 does not existIt means you don't have access to the GPT-4 fipas. To access it you must register forwaiting list.Your subscription aChatgpt Plus(paid version of Chatgpt) does not guarantee automatic access to the GPT-4 fipas, regardless of whether you are equipped or not.

If you mistakenly choose GPT-4 instead of GPT-3.5 or you have inserted an incorrect bees key, you can correct it by clicking on theUpdate Keybutton to specify the model type and the correct API key. Once finished, you can verify it by clicking onCheck Keybutton.

Sometimes, the chatgpt bees behave strangely and begins to produce errors. If before the additional component worked correctly but now returns errors, I suggest you try again sometimes. If the problem persists, report it.

Listtended Source

Published in

If you want to stay updated onGPT chat for Microsoft Word Subscribe to our weekly newsletter

Comment first

Leave a comment

The email address will not be published.


*