Click here to Skip to main content
15,998,008 members

S Sansanwal - Professional Profile



Summary

    Blog RSS
6,590
Author
268
Authority
76
Debator
5
Editor
1
Enquirer
58
Organiser
220
Participant
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
GeneralWebresource.axd or WebForm_PostBackOptions undefined problem Pin
S Sansanwal17-Oct-06 17:02
S Sansanwal17-Oct-06 17:02 
GeneralRe: connecting MS access database to vb combo box and list box Pin
Tyrone888824-Feb-07 6:14
Tyrone888824-Feb-07 6:14 
GeneralSelectALL in Compact Framework Pin
S Sansanwal2-May-06 11:52
S Sansanwal2-May-06 11:52 
GeneralConverting HTML text to Word Pin
S Sansanwal1-Feb-06 16:23
S Sansanwal1-Feb-06 16:23 
The easiest way is to copy html text to clipboard and save to word.
But when you copy an html to clipboard using copy or cut, windows add initial lines which indicates
start and end of HTML, Selection and Fragment. So, to handle this we need to
create text to be copied into compatble to above requirement

The code for this is

            // Save text into clipboard<br />
            Object m = System.Reflection.Missing.Value;<br />
            DataObject clipDO = new DataObject();<br />
            // Convert into HTML with all tags before adding to clipboard<br />
            clipDO.SetData(DataFormats.Html, HtmlClipboardData(strHTML));<br />
            Clipboard.SetDataObject(clipDO, true); // Save to clipbaord<br />
<br />
            object typeHtml = (object)Word.WdPasteDataType.wdPasteHTML;<br />
            // Save from clipbaord to word<br />
// Here s is word selection<br />
            s.PasteSpecial(ref m, ref m, ref m, ref m, ref typeHtml, ref m, ref m);




Now, convert normal html text to clipboard one.

///
/// Convert to proper html like
/// Version:1.0
///StartHTML:000000137
///EndHTML:000000204
///StartFragment:000000149
///EndFragment:000000180
///StartSelection:000000149
////EndSelection:000000180
///
///
///File
///
///
///
///

/// <param name="html" />
/// <returns>
       private static string HtmlClipboardData(string html)<br />
        {<br />
            StringBuilder sb = new StringBuilder();<br />
            Encoding encoding = Encoding.UTF8;<br />
            string Header = @"<br />
        Version: 1.0<br />
        StartHTML: {0:000000}<br />
        EndHTML: {1:000000}<br />
        StartFragment: {2:000000}<br />
        EndFragment: {3:000000}<br />
        ";<br />
            string HtmlPrefix = @"<br />
        <!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN""><br />
        <html><br />
        <head><br />
        <meta http-equiv=Content-Type content=""text/html; charset={0}""><br />
        </head><br />
        <body><br />
        <!--StartFragment--><br />
        ";<br />
            HtmlPrefix = string.Format(HtmlPrefix, encoding.WebName);<br />
<br />
            string HtmlSuffix = @"<br />
        <!--EndFragment--><br />
        </body><br />
        </html><br />
        ";<br />
<br />
            // Get lengths of chunks<br />
            int HeaderLength = encoding.GetByteCount(Header);<br />
            HeaderLength -= 16; // extra formatting characters {0:000000}<br />
            int PrefixLength = encoding.GetByteCount(HtmlPrefix);<br />
            int HtmlLength = encoding.GetByteCount(html);<br />
            int SuffixLength = encoding.GetByteCount(HtmlSuffix);<br />
<br />
            // Determine locations of chunks<br />
            int StartHtml = HeaderLength;<br />
            int StartFragment = StartHtml + PrefixLength;<br />
            int EndFragment = StartFragment + HtmlLength;<br />
            int EndHtml = EndFragment + SuffixLength;<br />
<br />
            // Build the data<br />
            sb.AppendFormat(Header, StartHtml, EndHtml, StartFragment, EndFragment);<br />
            sb.Append(HtmlPrefix);<br />
            sb.Append(html);<br />
            sb.Append(HtmlSuffix);<br />
<br />
            //Console.WriteLine(sb.ToString());<br />
            return sb.ToString();<br />
        }
#endregion



Sanjay Sansanwal
www.sansanwal.com
GeneralPostback in WebControl Pin
S Sansanwal18-May-05 12:25
S Sansanwal18-May-05 12:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.