Skip to content

Commit 44b1b24

Browse files
committed
Update README.md
1 parent 5433143 commit 44b1b24

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,20 +159,40 @@ c:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /codebase /tlb ChatGp
159159

160160
### Microsoft Work 2010
161161

162-
Add `ChatGPT\ChatGptCom\bin\Release\net462\ChatGptCom.tlb` to `References`.
162+
Add `ChatGPT\ChatGptCom\bin\Release\net462\ChatGptCom.tlb` to `References` using `Tools > References...` menu in `Microsoft Visual Basic for Applications`.
163163

164164
```vba
165+
Option Explicit
166+
167+
168+
Private WithEvents m_eventSource As Chat
169+
170+
171+
Sub Chat_Initialize()
172+
Set m_eventSource = New ChatGptCom.Chat
173+
End Sub
174+
175+
176+
Sub Chat_Send()
177+
m_eventSource.SendAsync "You are a professional translato to English.", "Cześć, witamy z Office VBA"
178+
End Sub
179+
180+
181+
Sub m_eventSource_OnSendCompleted()
182+
MsgBox m_eventSource.Result
183+
End Sub
184+
185+
165186
Sub ChatGpt()
166187
167188
Dim myObj As ChatGptCom.Chat
168189
Set myObj = New ChatGptCom.Chat
169190
170-
MsgBox myObj.Send("You are a professional translato to English.", "Cześć, witamy z Office VBA")
191+
myObj.SendAsync "You are a professional translato to English.", "Cześć, witamy z Office VBA"
171192
172193
End Sub
173-
```
174194
175-
```vba
195+
176196
Sub GetEnvironmentVariable()
177197
Dim envVarName As String
178198
Dim envVarValue As String

0 commit comments

Comments
 (0)