MauricioUY

Hi,
I'm working with Outlook 2003, Windows XP and .Net framework 1.1.
I had made a web page which have a windows .net user control embedded (in an object tag).

This control runs ok in IE and if I browse this in Outlook it also runs ok, BUT if a put this web page like the deafault web page of Outlook Today folder this page loads but not the user control....


It seems like a security problem....

any ideas

thanks a lot,
Mauricio.




Re: Visual Studio Tools for Office Outlook today folder with a Web page did not load an user control

X4U

Hello Mauricio,

do you display the Webpage just from an file, or from a Webserver like IIS or Cassini.

As I know you need the page running from a webserver, where the .Net appdomain is loaded.

Greets, Helmut






Re: Visual Studio Tools for Office Outlook today folder with a Web page did not load an user control

MauricioUY

Hello Helmut,

yes, I'm loading the web page from an IIS webserver (my site is an asp.net site).

The control loads ok if I browse the web page in Internet Explorer, my problem is when I want to load this web page like the Outlook Today default web page.

thanks,

Mauricio.






Re: Visual Studio Tools for Office Outlook today folder with a Web page did not load an user control

X4U

Hello Mauricio,

back in old ActiveX days there was an security setting under

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\0

1201 I beleive -

but I'm not sure what value have to be changed to allow unsafe ActiveX Controls.

You have to google for this registry key.

But changing this value opens a security risk.

Hope this helps,

greets, Helmut






Re: Visual Studio Tools for Office Outlook today folder with a Web page did not load an user control

MauricioUY

Hello Helmut,

I tried your suggest and google for that registry key, one of the results are: http://support.microsoft.com/kb/833633, so I modified the resgistry and try again to run my web page like the Outlook Today default web page without any results Sad

I do not understand what is the difference between browse a web page like Outlook Today default web page and browse the same web page using the "Address" option in Outlook command bar... any ideas

thanks!,

Mauricio.






Re: Visual Studio Tools for Office Outlook today folder with a Web page did not load an user control

X4U

as I know the TodayPage is loaded in the Outlook Application Process and from there you can access Properties like ActiveExplorer, Session, etc.

If you just display a Webpage by navigating using the AddressBar, the Page is loaded into the IE Process.

But wait, there's a trick that you can use to navigate to a webpage if that helps.

You can get the url Address Textfield by ID 1740 via the CommandBar and set the Text value to your url.

It's the same like typing the url and navigate to that page manually.

see also

http://www.outlookcode.com/codedetail.aspx id=449

Hope this helps,

greets, Helmut






Re: Visual Studio Tools for Office Outlook today folder with a Web page did not load an user control

MauricioUY

Hi,

yesterday I was trying to do something like that, my code is this:

-----------------------------------------------------------------------------------------------

private void button1_Click(object sender, System.EventArgs e)
{
Outlook.Explorer lExplorer = olkApp.ActiveExplorer();
MessageBox.Show(lExplorer.Caption);
foreach(Microsoft.Office.Core.CommandBar lCom in lExplorer.CommandBars)
{
//MessageBox.Show(lCom.Name);
if (lCom.Name == "Web")
{
foreach(Microsoft.Office.Core.CommandBarControl lCtrl in lCom.Controls)
{
MessageBox.Show(lCtrl.Caption);
if (lCtrl.Caption.IndexOf("Dir")>=0)
{
lCtrl.Tag = "http://www.google.com";
MessageBox.Show(lCtrl.Parameter);
lCtrl.Execute();
}
}
}
}
Marshal.ReleaseComObject(lExplorer);
}

----------------------------------------------------------------------------------------------

But I could not find the proper property to set the URL to the object "msoControlAutoCompleteCombo", now I will try to do this with the code you pass to me and I will tell you..........

thanks a lot,

Mauricio.






Re: Visual Studio Tools for Office Outlook today folder with a Web page did not load an user control

MauricioUY

Hello,

The solution in VBA works fine, but with .NET 2003 does not...

this is my code:

--------------------------------------------------------------------------

Outlook.Explorer lExplorer = olkApp.ActiveExplorer();
Microsoft.Office.Core.CommandBarComboBox lURL;

lURL = (Microsoft.Office.Core.CommandBarComboBox)lExplorer.CommandBars.FindControl(26, 1740,
System.Reflection.Missing.Value,System.Reflection.Missing.Value); //1740
lURL.Text = "http://www.google.com";
lURL.Execute();

--------------------------------------------------------------------------

but this code throw an error in this line: lURL.Text = "http://www.google.com";

the error: "error: cannot assign '"http://www.google.com"' into 'lURL.Text'"

Inmeddiate window:

lURL == null
false
lURL.Text
error: 'lURL.Text' does not exist
lURL.Text = "
http://www.google.com";
error: managed EE does not understand expression's syntax
lURL.Text = "
http://www.google.com";
error: managed EE does not understand expression's syntax
lURL.Text = "
http://www.google.com"
error: cannot assign '"
http://www.google.com"' into 'lURL.Text'

--------------------------------------------------------------------------

lURL have a SystemComObject, but I could not access its properties......

any ideas

thanks!,

Mauricio.






Re: Visual Studio Tools for Office Outlook today folder with a Web page did not load an user control

X4U

Hello Mauricio,

try this one:

Code Block

/// <summary>

/// This Method navigates to the give url inside of Outlook

/// </summary>

/// <param name="url"></param>

public void NavigateToUrl(string url)

{

try

{

// Find the Url CommandBarControl

Office.CommandBarControl urlNavigator = _Explorer.CommandBars.FindControl(26, 1740, _Missing, _Missing);

// set the Text value

urlNavigator.GetType().InvokeMember("Text", BindingFlags.SetProperty, null, urlNavigator, new object[] { url });

urlNavigator = null;

}

catch (System.Exception ex)

{

// log the error always

Trace.TraceError("{0}: [class]:{1} [method]:{2}\n[message]:{3}\n[Stack]:\n{4}",

DateTime.Now, // when was the error happened

MethodInfo.GetCurrentMethod().DeclaringType.Name, // the class name

MethodInfo.GetCurrentMethod().Name, // the method name

ex.Message, // the error message

ex.StackTrace // the stack trace information

);

}

}

This is an Forms20 Control.

The ComboBox has a Text Property.

We set this by using latebinding.

This is working for me.

I tested with my Sample OutlookAdminTools from my Homepage:

http://www.x4u.de/Programming/Outlook/tabid/54/Default.aspx

Hope this helps,

greets, Helmut