NullReferenceExceptionin Aspose Words DLL

I am getting an error:


An exception of type ‘System.NullReferenceException’ occurred in Aspose.Words.dll but was not handled in user code

Using this code with this Template document that is attached.

protected override void OnLoad(EventArgs e)
{
Management.Application.SetAsposeLicense(typeof(Aspose.Words.License));
string strFileName = Server.MapPath("/Uploads/Test.docx");
Aspose.Words.Document doc = new Aspose.Words.Document(Server.MapPath("/Uploads/Public/Documents/ACH-Policy-Tamplate2.docx"));
string REGEX_PATTERN = @"{[^}]*}";
doc.Range.Replace(new Regex(REGEX_PATTERN), new ReplaceEvaluatorCpScripting(), false);
doc.Save(strFileName);
base.OnLoad(e);
}

public class ReplaceEvaluatorCpScripting : Aspose.Words.IReplacingCallback
{
public ReplaceEvaluatorCpScripting()
{
}

///
/// This method is called by the Aspose.Words find and replace engine for each match.
/// This method highlights the match string, even if it spans multiple runs.
///
Aspose.Words.ReplaceAction Aspose.Words.IReplacingCallback.Replacing(Aspose.Words.ReplacingArgs e)
{
string strHtml = @"

Shelf:  *

Folder: *

Page 1 of 3

Internet Use Filtering and Monitoring Policy

Effective Date: 4/16Current Revision Date: 

Policy-

CHANGE the security of confidential patient data from Internet-based threats is imperative. A layered and strong security strategy will work to stop data from leaving the network at the perimeter and assist health organizations in complying with HIPAA regulations. Cyber risks can gravely impact organizational operations, the ability to access and transmit crucial patient data, and capacity to sustain a safe and productive environment for employees and patients.

The quality of healthcare provided by health organizations relies upon a secure network and readily accessible patient data, which can be safeguarded through sound Internet filtering. Filtering allows organizations to proactively defend against threats, prevent productivity loss from unmanaged online access, and minimize the risk of legal liability.

Definition

Internet Filtering: The use of technology to monitor instances of communication between devices on a network and the Internet as well as block traffic according to specific rules

User ID: Identifier used by associates to log into [ORGANIZATION NAME] network(s)

IP Address: Unique network address possessed by each device, permitting communication with other Internet capable devices on the network

SMTP: Simple Mail Transfer Protocol—the protocol that facilitates the mail messages exchange between Internet mail servers

Peer-to-Peer File Sharing: Services such as BitTorrent that permit hosts to upload files available for download by

other hosts

Social Networking Services: Internet sites such as Facebook that allow users to interact in online communications

and as well as share and post content

SPAM: Unsolicited Internet e-mail

Phishing: The attempt to fraudulently gain sensitive information by disguising oneself as a trusted entity in an

Internet communication

Hacking: Sites that offer information about subverting or violating computer security controls

Purpose-

The purpose of this policy is to outline standards for systems that limit and monitor Internet use from any host within [ORGANIZATION NAME]’s network. These standards are created to guarantee employees responsibly and safely use the Internet, and ensure that employee Internet use can be researched or monitored during an incident.

Equipment-

Virtual Desktops

Physical Personal Computers

Laptops

Ipads

Smart Phones (Using the Hosptial Internet)

Procedure

Website Monitoring

  1. The Information Technology Department will monitor Internet use of all devices and computers connected to the [ORGANIZATION NAME] network
  2. The monitoring system must record the source IP for all traffic as well as date, time, address, protocol, and destination server or site
    1. In addition, the system shall record the user ID of the account of the individual initiating the traffic
    2. Records of Internet use must be maintained for at least 180 days
    3. Access to Website Monitoring Reports

      1. Trending reports and General Activity shall be made available to employees as needed upon request to the Information Technology Department (IT)
      2. Members of [ORGANIZATION NAME] security response team may access all data and reports if necessary to respond to a security incident
      3. Internet Use reports that identify specific sites, teams, devices, or users shall only be available to employees outside the security response team upon email or written request to IT from a Human Resources (HR) Representative
      4. Internet Use Filtering Rule Changes

        1. The Information Technology Department shall periodically review and recommend changes to protocol and Internet filtering rules
        2. Human Resources shall review IT’s recommendations and determine if changes will be made
          1. Changes to protocol and Internet filtering rules will be recorded in the Internet Use Filtering And Monitoring Policy
          2. Internet Use Filtering Exceptions

            1. If a site is erroneously categorized, employees may submit a ticket to the IT Help Desk to request the site be unblocked
            2. An IT employee will review the request and unblock the site if it is erroneously categorized
            3. Enforcement

              1. The IT Security Officer shall systematically review filtering systems, Internet use monitoring, and processes to ensure compliance with this policy
              2. Employees found in violation of this policy may be subject to discipline, up to and including employment termination
              3. Approved by: 

                Revision dates:  4/16

                Author:  Dan Yarian

                ";
                if (!String.IsNullOrEmpty(strHtml))
                {
                Aspose.Words.DocumentBuilder builder = new Aspose.Words.DocumentBuilder((Aspose.Words.Document)e.MatchNode.Document);
                builder.MoveTo(e.MatchNode);
                builder.InsertHtml(strHtml, true);
                }
                e.Replacement = String.Empty;
                return Aspose.Words.ReplaceAction.Replace;
                }
                }


                The HTML appears to be breaking this when using this specific template word document only. Any help would be greatly appreciated. Thank you!

                Hi there,


                Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-13500. You will be notified via this forum thread once this issue is resolved.

                We apologize for your inconvenience.

                The issues you have found earlier (filed as WORDSNET-13500) have been fixed in this .NET update and this Java update.


                This message was posted using Notification2Forum from Downloads module by aspose.notifier.