Click here to Skip to main content
14,134,152 members

S Sansanwal - Professional Profile



Summary

    Blog RSS
6,466
Author
268
Authority
76
Debator
5
Editor
1
Enquirer
58
Organiser
220
Participant
No Biography provided

Reputation

For more 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 frequencysilversilversilversilverAdmin
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSitebuilder, Subeditor, Mentor, Protector, Editor, Staff, Admin
Store personal files in your account areaplatinumplatinumSitebuilder, Subeditor, Supporter, Editor, Staff
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubeditor, Protector, Editor, Staff, Admin
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubeditor, Protector, Editor, Staff, Admin
Edit a Question in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Edit an Answer in Q&AsilversilversilversilverYesSubeditor, Protector, Editor, Admin
Delete a Question in Q&AYesSubeditor, Protector, Editor, Admin
Delete an Answer in Q&AYesSubeditor, Protector, Editor, Admin
Report an ArticlesilversilversilversilverSubeditor, Mentor, Protector, Editor, Staff, Admin
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubeditor, Mentor, Protector, Editor, Staff, Admin
Edit other members' articlesSubeditor, Protector, Editor, Admin
Create an article without requiring moderationplatinumSubeditor, Mentor, Protector, Editor, Staff, Admin
Approve/Disapprove a pending QuestionProtector, Admin
Approve/Disapprove a pending AnswerProtector, Admin
Report a forum messagesilversilverbronzeProtector, Editor, Admin
Approve/Disapprove a pending Forum MessageProtector, Admin
Create a new tagsilversilversilversilverAdmin
Modify a tagsilversilversilversilverAdmin

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
memberS Sansanwal17-Oct-06 17:02 
GeneralRe: connecting MS access database to vb combo box and list box Pin
Tyrone888824-Feb-07 6:14
memberTyrone888824-Feb-07 6:14 
GeneralSelectALL in Compact Framework Pin
S Sansanwal2-May-06 11:52
memberS Sansanwal2-May-06 11:52 
GeneralConverting HTML text to Word Pin
S Sansanwal1-Feb-06 16:23
memberS 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.

/// <summary>
/// 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 PinPopular
S Sansanwal18-May-05 12:25
memberS 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.


Advertise | Privacy | Cookies | Terms of Service
Web06 | 2.8.190518.1 | Last Updated 22 May 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid