title: Implementing BeginInvoke() in Office AddIn C#
body: <p>I have a method in my class code that I want to run asynchronously by  invoking it using <strong>BeginInvoke()</strong> . I had earlier attempted to use  a <strong>Dispatcher</strong> but it turns out it is not available for WinForms applications and Office addins,hence the use of BeginInvoke().</p>
  
  <p>The code is below:</p>
  
  <pre><code>private delegate void InvokeMacroDelegate();
  
  private void Process()
      {
          this.BeginInvoke(new InvokeMacroDelegate(OnlineStream));
      }
  
  private void OnlineStream()
      {
          //some process here
      }
  </code></pre>
  
  <p>I get the error below</p>
  
  <blockquote>
    <p>'ThisAddIn' does not contain a definition for 'BeginInvoke' and the
    best extension method overload
    'DispatcherExtensions.BeginInvoke(Dispatcher, Action)' requires a
    receiver of type 'Dispatcher'</p>
  </blockquote>
  
  <p>What's the problem here and what's the fix?
  Thanks.</p>