Add an element "P" in the document

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

Add an element "P" in the document
After each tag "P" i need to add a new tag "P" 
Fady Sayegh




Posts: 7
Joined: 2012-09-12
Hi All,

i'm trying to parse all the "P" tags of the html document and under each on of them i need to a new tag "P".

int i = 0;
mshtml.IHTMLElementCollection Elems = HTMLDocument.getElementsByTagName("P");
mshtml.IHTMLElement oElementToAdd = null;

foreach (mshtml.IHTMLElement Elem in Elems)
{
oElementToAdd = oHTMLDocument.createElement("P");
oElementToAdd.innerText = "Appended element " + i++.ToS tring();

// Insert the P TAG
}

in the above snipped code, i'm looping through all the P tags in the document, for each p tag i'm creating a new "P" tag but i'm not able to find a solution to add the new "P" tag (oElementToAdd in the snipped code).

can you please indicate me how to do

best regards and thanks in advance

Fady Sayegh
Posted 17 Sep, 2012 05:06:58 Top
Eugene Astafiev


Guest


Hi Fady,

Please take a look at the http://www.add-in-express.com/forum/read.php?FID=10&TID=11024 forum thread.
Posted 17 Sep, 2012 05:49:05 Top