سؤال

I created an office 2013 addin for outlook. I've created a ribbon that has a label and a button adn i place this in the appointment section in outlook.

ribbon xml:

 <ribbon>
    <tabs>
      <tab idMso="TabAppointment">

        <group id="Beställning"
               label="Beställningar">
          <button id="MyButton"
                    size="large"
                    label="Beställ"
                    imageMso="HappyFace"
                    onAction="RedirectToOrder"/>
        </group>
      </tab>
    </tabs>
  </ribbon>

As you can see from the xml i have created a button that has a callback that gets executed.

public void RedirectToOrder(Office.IRibbonControl control, bool isPressed)
{
    //Response.Redirect("HTMLPage1.html");

}

I have created a simple html page. What I am trying to do:

When i click the button i want to redirect to my html page. the simple Response.Redirect does not seem to work

Ive been all arround the web and have not been able to find anything on this.

هل كانت مفيدة؟

المحلول

I got some help from a frirend and he told me that i would have to start a browerser and send in a link as a paramater to the browser.

In my particular case i would have to store my htmlpage somewhere on my harddrive ( c/temp/htmlPage.html) and send that address as the argument but in order to simplyfy this:

 public void RedirectToOrder(Office.IRibbonControl control, bool isPressed)
        {

            System.Diagnostics.Process.Start(@"C:\Program Files (x86)\Internet Explorer\iexplore.exe", "http://movies.com");

        }

hope it can help others!

EDIT:

I forgot 2 mention that i also had to change the xml...change the "button" to "toggleButton" or the callback method will never get run.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top