Suppress user properties/custom fields when print in Outlook

Source: Internet
Author: User

        /// <summary>        ///Suppress User property when Printing. /// http://stackoverflow.com/questions/701508/suppressing-outlook-field-printing        /// </summary>        /// <param name= "UserProperty" ></param>         Public Virtual voidsuppressuserpropertyprinting (OL. UserProperty UserProperty) {Try            {                if(UserProperty = =NULL)return;//no prop found//late Binding in. NET:http://support.microsoft.com/default.aspx?scid=kb; en-us;302902Type Userpropertytype; LongDispidmember =107; LongUlpropprintable =0x4;//removes Pdo_print_saveas                stringDispmembername = String.Format ("[dispid={0}]", Dispidmember); Object[] dispparams; Userpropertytype= Userproperty.gettype ();//User Property Type//Call IDispatch::Invoke to get the current flags                ObjectFlags = Userpropertytype.invokemember (Dispmembername, BindingFlags.GetProperty,NULL, UserProperty,NULL); //default is-//pdo_is_custom| pdo_print_saveas| Pdo_print_saveas_def//Ref:http://msdn.microsoft.com/en-us/library/ee415114.aspx                LongLflags =Long. Parse (Flags.                ToString ()); //Remove The Hidden property Printable flag//Change to -//pdo_is_custom| Pdo_print_saveas_def//Ref:http://msdn.microsoft.com/en-us/library/ee415114.aspxLflags &= ~ulpropprintable; //Place the new argument arrayDispparams =New Object[] {lflags}; //Call IDispatch::Invoke to set the current flagsUserpropertytype.invokemember (Dispmembername, BindingFlags.SetProperty,NULL, UserProperty, dispparams); }            Catch{ }//safely ignore if property suppression doesn ' t work}

When printing Outlook Mail item, appointment item etc, the custom user defined fields would display. The above method Fixs this issue by change the update Flags from pdo_is_custom| pdo_print_saveas| Pdo_print_saveas_def to Pdo_is_custom| Pdo_print_saveas_def.

Suppress user properties/custom fields when print in Outlook

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.