Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6850421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:07:21+00:00 2026-05-27T01:07:21+00:00

How do I set the url of an htmldocument after I’ve written to it.

  • 0

How do I set the url of an htmldocument after I’ve written to it. For example:

WebBrowser wb = new WebBrowser();
wb.Navigate(new Uri(location, UriKind.Absolute));
IHTMLDocument2 myDoc = new HTMLDocumentClass();
myDoc.write(new object[] { wb.DocumentText});
myDoc.close();

If I do myDoc.url = "http://www.google.com" it attempts to load google.
How do I set the url without having it attempt to load that url?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:07:22+00:00Added an answer on May 27, 2026 at 1:07 am

    These steps should give you a document with correct URL and your own content:

    1. Create document directly from URL (so you don’t have to set the URL later)
    2. Stop document download (because you don’t need the content)
    3. Fill document with your content

    This code shows how to do it:

    // 1. Create new document from URL
    IHTMLDocument2 NewDoc = (wb.Document as IHTMLDocument4).createDocumentFromUrl("http://www.stackoverflow.com", "null");
    // 2. Immediately stop navigating; the URL is still set
    NewDoc.execCommand("Stop", false, null);
    // 3. Now write your stuff to the document
    // ... 
    

    Note: It’s hard to guess how much content can be downloaded between steps 1 and 2 because loading happens asynchronously. So it’s probably good to check if the document is indeed empty before doing step 3. If not, clear the document and proceed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When would you set location to a URL string versus setting location.href ? location
when I open popup window and set location=0 or location=no, url bar is still
@search_results = Array.new duplicates = Set.new results.each { |result| @search_results.push(result) unless duplicates.add?(result[:url]) } This
Is it possible to set a base url on a page with a relative
The set up for apache-jmeter allows for a URL to be sent to a
I would like to set values on an url like this: <a href='http://$data_url/viewyournote.php?chapter='$name_of_chapter'&note='$id_note'&user='$username'> Then
I am trying to set and catch the URL variable It begins with a
I need to set up some RewriteRules to redirect a URL which has a
I've set up a CRON to call a URL in Kohana 3. php /home/user/public_html/index.php
I need to create an NSImage from a url and then set it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.