How to use Javascript using Addins

Add-in Express™ Support Service
That's what is more important than anything else

How to use Javascript using Addins
 
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Hi Rajesh,

I am sorry but your questions are beyond the scope of our support service because they don't relate directly to Add-in Express. They are related to the MSHTML object model, which is comprehensively described on MSDN.
Please have a look at the following page, which contains all details about HTML objects:
http://msdn.microsoft.com/en-us/library/aa741317(v=vs.85).aspx
Posted 13 Sep, 2011 12:35:46 Top
raju kumar




Posts: 20
Joined: 2011-08-13
Hi Sergey,
Now i am getting the value from hotmail Composemail whatever i enter in 'TO' address.But the main problem is immediately the value is not coming.Its taking 3-4 minutes after that the value is showing whatever i enter.So how can i get the value immediately.Please let me know..I am writing the below code...

object[] listhotmail = AddinExpress.IE.ADXIEHelper.GetHTMLElementsByName(this.HTMLDocument, "fTo");
if (listhotmail.Length > 0)
{
if (listhotmail[0] is mshtml.IHTMLTextAreaElement)
{
string testhot = (listhotmail[0] as mshtml.IHTMLTextAreaElement).value;

MessageBox.Show(testhot);
}
else if (listhotmail[0] is mshtml.IHTMLInputTextElement)
{
string testhot = (listhotmail[0] as mshtml.IHTMLInputTextElement).value;

MessageBox.Show(testhot);
}
}

Thanks
Raju
Posted 13 Sep, 2011 14:01:58 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Hi Raju.

It may happens if a web page contains many elements. The ADXIEHelper.GetHTMLElementsByName method uses the 'getElementsByName' method of the HTML document. http://msdn.microsoft.com/en-us/library/aa752544(v=VS.85).aspx
So, I am not sure if it is possible to speed up its performance. I can provide you the source code of the ADXIEHelper.GetHTMLElementsByName method if you wish. Probably you will manage to optimize it for your purposes.
Posted 14 Sep, 2011 08:52:18 Top
raju kumar




Posts: 20
Joined: 2011-08-13
Hi Sergey,
I am having one trouble..Can you please tell me how can we get the current login id in gmail Using Addin express in c#?

Thanks
Posted 15 Sep, 2011 14:58:54 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Hi Raju,

Add-in Express doesn't implement such a functionalty because the implementation depends on the web page and browser settings. Probably you just need to search for the id in cookies files. Of course, the cookies can be disabled in IE.
Posted 16 Sep, 2011 09:43:18 Top
raju kumar




Posts: 20
Joined: 2011-08-13
Hi,Sergey,
Thanks for your post.I have 1 more problem over here.i wrote the code for sending message.But when mail is sent it is saving the Draft.But not saving in the inbox or in spam..

Can we resolve this issue??

Thanks
Rajesh
Posted 20 Sep, 2011 09:33:07 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Hi Rajesh,

Do you receive an email which is sent programmatically? If not, I guess that there is an error in the code.
Posted 21 Sep, 2011 07:21:46 Top
raju kumar




Posts: 20
Joined: 2011-08-13
Hi Sergey,
I am writing the code to send mail.But in my local system it is working file But when i create a set up and testing some other system then i am getting an error as like below:-

Microsoft .NET Framework exception
unable to cast com object of type 'system.__comobject' to class type mshtml.htmlbody class.......

And i am writing the code like below.--
object[] listlogin = AddinExpress.IE.ADXIEHelper.GetHTMLElementsByName(this.HTMLDocument, "to");
if (listlogin.Length > 0)
{
if (listlogin[0] is mshtml.IHTMLTextAreaElement)
{

logon = (listlogin[0] as mshtml.IHTMLTextAreaElement).value;

}
else if (listlogin[0] is mshtml.IHTMLInputTextElement)
{
logon = (listlogin[0] as mshtml.IHTMLInputTextElement).value;
}
}
This is to get the To Address from gmail Compose mail.So How can w rectify this error..Please help me.

Thanks
Posted 22 Sep, 2011 07:13:14 Top
Sergey Grischenko


Add-in Express team


Posts: 7224
Joined: 2004-07-05
Hi Rajesh,

You need to use try...catch to determine where exactly the exception occurs.
Posted 23 Sep, 2011 05:20:58 Top