-
Not able to access message editor of Yahoo Email
Hi,
I am trying to fill out Yahoo Email’s typical 'Compose Mail' webpage, the page with the To, CC, BCC fields and the message editor. I am able to access the To, CC, Subject fields but not able to access the message editor. Somebody told me that the editor is part of iframes. The following is the code associated with the editor.
How could I access the editor? Thanks. MG.
Code:
<div id="rteContainer" class="fields">
<noscript>
<style>
#rteContainer { display:none; }
#composebox textarea { display:block !important; }
</style>
</noscript>
<script type="text/javascript">
createRTE();
</script>
</div>
I can post the source code of the web page if you need it. Please let me know.
-
from the "noscript" action here, it seems the Composer item id is "composebox" ... if u inject a getElementById u would reach it ... how do u want to access the composer? by something like Greasemonkey for example?
-
Amahdy,
Thanks. I am using VBA to access the text editor. I want to be able to put my text in the editor. For example, to access the 'to' field, I am using the following code.
Set htmlColl = htmlDoc.getElementsByTagName("input")
For Each htmlInput In htmlColl
If htmlInput.name = "Subj" Then htmlInput.Value = ocell.Offset(0, 1).Value
Next htmlInput
Last year I was able to access the editor using the following code. But now it is not working. My guess is Yahoo has changed the code of the webpage.
htmlDoc.getElementById("rteEditorComposition0").contentWindow.document.getElementById("0") .innerHTML = message
-
I've just opened my old yahoo mail, in the "Yahoo Mail Beta" interface, and inspected the compose element, and yes it's an iframe called "compArea_test_1", and typing inside it is simply editing the iframe inside body-html, i.e. get the element "compArea_test_1" and jumb to the body and then write in it your message body in HTML format ... am not sure about the exact code for doing that it needs some try and error, but the general idea as I told u is:
inside the emlement id="compArea_test_1" , inside the <body> tag : write the message.
-
Thanks. Unfortunately my yahoo is not the same (just the regular yahoo email and not the beta version). My page does not have the ifram compArea_test_1. I am attaching part of the source code of my webpage here. In the mean time I will try to see if I can convert my account into the beta version.
Code:
<input type="hidden" value="{"QQQQ@yahoo.com":{"address":"QQQQ@yahoo.com","frmName":"PPPP","replyTo":"","pop":"","type":"frmaddress"},"PPPP@yahoo.com":{"address":"PPPP@yahoo.com","frmName":"PPPP","replyTo":"","type":"default","pop":""}}" name="frmAdrsObj"> <div class="fields row">
<p>
<a id="insert_address" href="#">Insert addresses</a> (separated by commas) <noscript><style>
#insert_address { text-decoration:none;color:#000;cursor:auto;}
</style></noscript>
<a id="hideBcc" onClick="hideBcc();" >Show Bcc</a>
</p></div> <div id="toid" class="row">
<label for="to" id="compose_to">
<b id="lb_to">To:</b>
</label>
<input type="text" class="txtfield" name="to" id="to" autocomplete="off" tabindex="2" value="">
</div>
<div id="ccid" class="row">
<label for="cc" id="compose_cc">
<b id="lb_cc">Cc:</b>
</label>
<input type="text" class="txtfield" name="cc" id="cc" tabindex="3" value="">
</div>
<div id="bccid" class="row">
<label for="bcc" id="compose_bcc">
<b id="lb_bcc">Bcc:</b>
</label>
<input type="text" class="txtfield" name="bcc" id="bcc" tabindex="4" autocomplete="off" value="">
</div>
<div id="Subjid" class="row">
<label for="Subj">Subject:</label><input type="text" tabindex="5" id="Subj" value="" name="Subj" class="txtfield"> </div>
<div style="clear:both;"></div>
<script type="text/javascript">
enhanceFields();
</script>
<input type="hidden" name="togglePlainTxt" class="inputbutton" value="1" />
<script type="text/javascript">
document.getElementById("Subjid").innerHTML='<label for="Subj">Subject:</label><input type="text" tabindex="5" id="Subj" value="" name="Subj" class="txtfield">';
</script>
<div class="fields" id="composeAttachButton">
<input type="submit" name="attachFiles" class="pim attachbutton " value="Attach Files" id="attachFiles" tabindex="6" />
</div>
<script type="text/javascript">
JSifyForm("dummyForm");
</script>
<span class="offscreen" id="plainLabel"><label for="composeArea">Message Body</label></span>
<span class="offscreen"><label for="compose_editorArea">Message Body</label></span>
<script type="text/javascript">
<!--
gLaunchProfile.start("T6");
-->
</script> <textarea id="composeArea" class="composecolumn" style="padding:5px 0 0 5px;width:545px;" name="Content" tabindex="7">
</textarea>
<div id="rteContainer" class="fields">
<noscript>
<style>
#rteContainer { display:none; }
#composebox textarea { display:block !important; }
</style>
</noscript>
<script type="text/javascript">
createRTE();
</script>
</div>
<script type="text/javascript">
<!--
gLaunchProfile.stop("T6");-->
</script> <script type="text/javascript">
document.getElementById("bccid").style.display="none";
function rembcc() {
document.getElementById('hideBcc').innerHTML = YAHOO.mc.Compose.uiStrings['REMOVE_BCC'];
document.getElementById('bccid').style.display='';
document.getElementById('showBcc').value = 'true';
}
document.getElementById("bccid").style.display="none";</script>
<noscript><style type="text/css"> #hideBcc {display:none;} </style></noscript>
</div></div>
<script type="text/javascript">
YAHOO.mc.Compose.globals.toggleLabel = '<span class=\"offscreen\">Compose using </span>Plain Text<span class=\"offscreen\"> editor</span>';
YAHOO.mc.Compose.globals.toggleTitle = 'Compose using Plain Text editor';
YAHOO.mc.Compose.globals.toggleURL = 'compose;_ylt=AhxXeSQ4v1HUNcujS8s78j61I74X?&.rand=736913683&da=0';
</script>
<script type="text/javascript">
<!--
gLaunchProfile.stop("T3");
-->
</script> <script type="text/javascript">
<!--
gLaunchProfile.start("T4");
-->
</script> <div class="composebuttonbar" id="composebuttonbarbottom">
<input accesskey="9"
type="submit" class ="inputbutton "
name="send" id="send_bottom" value="Send"
title="Send Message"
tabindex="8">
<input type="submit"
class ="inputbutton "
name="savedraft" id="save_bottom" value="Save Draft"
title="Save Message in your Drafts folder"
tabindex="9">
<input type="button"
class ="inputbutton " name="spell"
value="Spell Check (US English)"
title="Check your spelling before sending message" id="spellCheckbottom"
tabindex="10">
<style>
input#spellChecktop, input#spellCheckbottom { display:none; }
</style>
<input type="submit" id="cancelbuttonbottom" accesskey="0"
class ="inputbutton" name="cancel"
value="Cancel"
title="Cancel"
tabindex="11">
</div>
<script type="text/javascript">
<!--
gLaunchProfile.stop("T4");
-->
</script> <script type="text/javascript">
<!--
gLaunchProfile.start("T5");
-->
</script> <script type="text/javascript"> showToggleLink();
</script>
</form>
<script type="text/javascript">
JSifyForm("attachFiles");
</script>
<iframe name="iframeSpell" id="iframeSpell" class="offscreen"></iframe>
<form method="post" action="ymailSpell;_ylt=AvKqmQAfc49WGfSThuw0B2u1I74X?&.rand=736913683&da=0" name="spellForm" target="iframeSpell">
<input name="text" type="hidden" value="" id="spellHide" />
<input name="oformat" id="oformat" type="hidden" value="js" />
<input name="iformat" id="iformat" type="hidden" value="text" />
</form>
<script type="text/javascript">
<!--
gLaunchProfile.stop("T5");
-->
</script> </div>
<script type="text/javascript">
<!--
gLaunchProfile.stop("RPRenderTime");
gLaunchProfile.stop("BDRenderTime");
gLaunchProfile.start("BPRenderTime");
gLaunchProfile.start("FooterJSLoadTime");
-->
</script>
-
well I opened my mail again and switched it back to the classic interface, then inspected the element, it's the same technique: an iframe element id = "compose_editorArea" ... try the same I told u about it before with this id ...
-
Thanks. I tried that but did not work. See my code below. I tried different combinations in the second line but every time I got the error 91 : Object variable or With block variable not set
Set htmlColl = htmlDoc.getElementById("compose_editorArea")
MsgBox htmlColl.contentWindow.document.getElementById("0").innerHTML
Similar Threads
-
By tommy in forum VB Classic
Replies: 1
Last Post: 01-03-2002, 09:24 AM
-
By bapi in forum Architecture and Design
Replies: 1
Last Post: 09-02-2001, 09:11 AM
-
By Nate in forum Database
Replies: 29
Last Post: 05-09-2001, 10:04 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks