Webbrowser Control Errors
Webbrowser Control Errors
Webbrowser Control Errors
Webbrowser Control Errors
Webbrowser Control Errors
Webbrowser Control Errors Webbrowser Control Errors Webbrowser Control Errors Webbrowser Control Errors Webbrowser Control Errors Webbrowser Control Errors Webbrowser Control Errors Webbrowser Control Errors
Webbrowser Control Errors Webbrowser Control Errors
Webbrowser Control Errors
Go Back  Xtreme Visual Basic Talk > > > Webbrowser Control Errors


Reply
 
Thread Tools Display Modes
  #1  
Old 04-12-2010, 12:46 PM
smokey2k smokey2k is offline
Newcomer
 
Join Date: Apr 2010
Posts: 2
Default Webbrowser Control Errors


Ok so I am working on a program to try and help me automate my day to day activities with various online sites. With the economy in a little slump, I have had to let my data entry people go and rely solely on this program to help fill the gap.

Basically this site logs into a business networking website, and posts a new coupon and a blog every 3 days to keep our content fresh. The problem I am having is that I cannot get the control to fill in certain form fields, I have tried doing .innerhtml & .value to no avail with the same 2 error's; 1) Run-Time Error '424': Object Required.

And it highlights : blogtitle.Value = BlogText1

Here is the total code...
Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim zy As IHTMLInputTextElement, docu As HTMLDocument
Dim CouponOfferTXT, GenNewCoupon, spunTXT, spunTXT2, spunTXT3
If InStr(txtData.Text, "Create Blog Post") Then
'Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE
'DoEvents
'Loop
Pause 2
blogtitle = WebBrowser1.Document.getElementById("blogTitle")
BlogArticle = WebBrowser1.Document.getElementById("blogposttext")
BlogKWS = WebBrowser1.Document.getElementById("blogKeywords")
Pause 0.4
BlogText1 = spin(Form4.BlogTitleList1.Text)
Pause 0.3
BlogText2 = spin(Form4.BlogBodyList1.Text)
Pause 0.2
BlogText3 = spin(Form4.BlogKWList1.Text)
blogtitle.Value = BlogText1
Now when I change .value to .innertext I get same error, now the page's content are NOT dynamic.. the site is merchantcircle.com and here is a taste of the html....

HTML Code:
<script type="text/javascript">
//<![CDATA[


window.name = 'blog';

function openImagePicker(callback,movies)
{
    var movies = (movies == null) ? false : movies;
    var w = 460;
    var h = 470;
    
    window.pickerCallback = callback;

    var url = "/merchant/images/picker?context=blog";
    if (movies) {
        url = url + "&movies=1";
    }
    var winopts = "toolbar=no,location=no,directories=no,status=yes,";
    winopts = winopts + "menubar=no,scrollbars=yes,resizable=yes,";
    winopts = winopts + "width=" + w + ",height=" + h;
    var popupWin = window.open(url,"ImagePicker",winopts);
    popupWin.focus();
    return false;
}

//]]>
</script>


<script type="text/javascript">
//<![CDATA[
//when user clicks keywords, add them to the keywords list.
function addkw(word,dest) {
	var tgt = document.getElementById(dest);
	if (tgt == null)
		return false;
	var str = '';

	str = formatkw(tgt.value);
	str += ' ' + word;
	str = str.replace(/^\s*|\s*$/g,"");
	tgt.value = str;
	return 0;
}

//format the string in the keywords list. removes common splitter characters.
function formatkw(instr) {
	var splitby=/[,;\s]/;
	var replacechars = /[,;\s]/;
	var replacewith='';
	var fldval=instr.split(splitby); //split by , ; <space>
	outstr = '';
	
	for (var i=0;i<fldval.length;i++) {
		var nocma = fldval[i].replace(replacechars,replacewith); //remove ',' ';' convert to <space>
		nocma = nocma.replace(/^\s*|\s*$/g,"");
		outstr += nocma + ' ';
	}
	
	return outstr;
}

// Sync the text between the rte js iframe and the
// hidden textarea

var aurl = "http://www.merchantcircle.com/";
function syncRTE( ) {
	updateRTE('rte1');
	var newvalue = document.getElementById('hdnrte1').value;
	newvalue = newvalue.replace(/(src|href)="\/uploaded_content/g, 
					'$1="' + aurl + 'uploaded_content');
	document.getElementById('blogposttext').value = newvalue;
}

//]]>
</script>
</head>

<div id="wrapper">
	<div id="rightColumn">
		<div id="pageTitle">
			<h1><span id="subTextMainBar"></span> Create Blog Post</h1>
		</div>

		<div id="content">

		


<form id="blogwritepost" name="blogwritepost" action="/merchant/blog/writePostSubmit" method="post">
	<input type="hidden" name="company_id" value="32857382" />
<table width="100%"  cellspacing="0" class="tableHorizontal">
	<tr>
        <td>
			<strong>*</strong> <label for="blogTitle">Blog Title:</label><br />

			<input type="text" id="blogTitle" name="blogTitle" tabindex="1" value="" />
		    
		</td>
    </tr>
	<tr>
		<td>
			<strong>*</strong> <label for="blogposttext">Blog Body:</label><br />
			
			
			<textarea class="textarea" name="blogposttext" id="blogposttext" tabindex="3"></textarea>

		</td>
    </tr>
	<tr>
        <td>
			<strong>*</strong> <label for="blogKeywords">Keywords:</label><br />
			
			<input type="text" id="blogKeywords" name="blogKeywords" tabindex="3" onblur="this.value=formatkw(this.value);" value="" />
		</td>

    </tr>
	<tr>
        <td>
		<label>Suggested Keywords:</label>
			<a class="tag" href="javascript:void(0);" onclick="addkw('shirley','blogKeywords');">shirley</a> 
			<p class="note">We also suggest keywords that come from the blog article just entered.</p>
		</td>
    </tr>

</table>
<div class="bottomPanel">
		<input type="hidden" name="imgSrcHiddenField" id="imgSrcHiddenField" value="" />
		<input type="hidden" name="imgSrcUrlHiddenField" id="imgSrcUrlHiddenField" value="" />
		<input type="hidden" name="start" value="" />
		<input type="hidden" name="referrer" value="" />
			<input value="Cancel" type="button" id="buttonCancel" class="buttonOrange buttonLeft" tabindex="4" onclick="history.go(-1);" />
			<input value="Publish" type="submit" id="post_btn" class="buttonOrange" tabindex="5" />
</div>
</form>
<h3>Helpful Hints</h3>

<p>Text copied from MS Word causes frequent problems for the blog tool. MerchantCircle suggests that you do <strong>not</strong> cut and paste directly from MS Word into the blog. For best results, copy and paste from Word into a plain text document editor like Notepad then copy/paste from notepad into the blog.</p>

			<div class="mozFix"></div>
		</div>
	</div>
	<div id="left">
		



    <script type="text/javascript">
    function closeOpened(element) {
    	if ( ! hasElementClass(element, 'keepOpen') )
    		swapElementClass(element,'subOpen', 'subItem');
    }

    function toggleMenu(submenu) {
    	if (hasElementClass(submenu, 'subItem')) {
    		map(closeOpened, getElementsByTagAndClassName('ul', 'subOpen'));
    		swapElementClass(submenu, 'subItem', 'subOpen');
    	} else {
    		addElementClass(submenu, 'subItem');
    	}
    }
    </script>

    <script type="text/javascript">
    addLoadEvent(function(){
    	try{
    			if (pageTracker) {
    				pageTracker._setVar("Free")
    			}
    		} catch(e){}
    	});
    </script>



Does anyone see anything wrong with this? Every other site I have made something like this for has always worked 100% and then I got this issue, yet at one point when I defined it --- it worked, now im back at square 1. If no one has an answer for this, does anyone know where a good tutorial on webbrowser control for visual basic 6 is?
Reply With Quote
Reply

Tags
webbrowser


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Webbrowser Control Errors
Webbrowser Control Errors
Webbrowser Control Errors Webbrowser Control Errors
Webbrowser Control Errors
Webbrowser Control Errors
Webbrowser Control Errors Webbrowser Control Errors Webbrowser Control Errors Webbrowser Control Errors Webbrowser Control Errors Webbrowser Control Errors Webbrowser Control Errors
Webbrowser Control Errors
Webbrowser Control Errors
 
Webbrowser Control Errors
Webbrowser Control Errors
 
-->