Thank you, Muhammad.
Programmers who are using ColdFusion and other non-NET languages really need a list of what Objects, Classes, Methods and Properties are available in the .NET Aspose.Words.DLL, along with examples of the syntax that the programmer should use (in CF, etc.) If you made these lists, it would be a big selling point for programmers of non-NET languages.
That’s why it’s been so difficult for me: I’ve been limited to only those objects, methods, etc. that are shown in the CF examples.
I’ve tried to use the Aspose.Words.chm help file, but it doesn’t show the proper syntax in ColdFusion and it is really difficult to try to change the syntax of C# and VB to ColdFusion’s syntax.
The syntax of the code that works:
<!— Install Aspose License using CF Tags —>
<cfset license=CreateObject(".NET", "Aspose.Words.License", assemblyPath).Init()>
<cfset license.SetLicense("C:\Aspose\Aspose.Words.lic")>
<!— Alternate way to Install Aspose License using CFScript —>
license=CreateObject(".NET", "Aspose.Words.License", assemblyPath).Init();
license.SetLicense("C:\Aspose\Aspose.Words.lic");
<cfset protocolDoc=CreateObject(".NET", "Aspose.Words.Document", assemblyPath).Init()>
<cfset saveFormat=CreateObject(".NET", "Aspose.Words.SaveFormat", assemblyPath)>
<cfset protocolDoc.Save("#somepath##somefile#", saveFormat.Doc)>
<cfset FileSetAttribute("#somepath##somefile#","normal")>
<cfset srcDoc=CreateObject(".NET", "Aspose.Words.Document", assemblyPath).Init("#somepath##somefile#.doc")>
<cfset importFormatMode=CreateObject(".NET", "Aspose.Words.ImportFormatMode", assemblyPath)>
<cfset protocolDoc.AppendDocument(srcDoc, importFormatMode.KeepSourceFormatting)>
<br>builder = CreateObject(".NET", "Aspose.Words.DocumentBuilder", assemblyPath).init(); <br>//the above worked with no error<br><br>Some examples of the errors that I am getting are:<br><br>pSetUp = protocolDoc.PageSetup;<br>//Element PAGESETUP is undefined in PROTOCOLDOC.<br><br>sections = protocolDoc.Sections;//get the sections collection<br>//Element SECTIONS is undefined in PROTOCOLDOC. <br><br>Section = protocolDoc.Sections();<br>//The Sections method was not found. <br><br>paragraphs = protocolDoc.GetChildNodes(NodeType.Paragraph, True);<br>//Element PARAGRAPH is undefined in NODETYPE. <br><br>page = protocolDoc.Pages.Add();<br>//Element PAGES is undefined in PROTOCOLDOC. <br><br>section = CreateObject(".NET", "Aspose.Words.Section").init();<br>//Class Aspose.Words.Section not found in the specified assembly list. <br><br>Section=CreateObject(".NET", "Aspose.Words.Section(0)",
assemblyPath).Init("#somepath##somefile#.doc");
//Class Aspose.Words.Section(0) not found in the specified assembly list.
Section = protocolDoc.Sections(0);
//The Sections method was not found.
protocolDoc.Sections.Clear();
//Element SECTIONS is undefined in PROTOCOLDOC.
Node=CreateObject(".NET", "Aspose.Words.Node", assemblyPath).Init();
//Unable to find a constructor for class Aspose.Words.Node that accepts parameters of type ( ‘’ ).
Node=CreateObject(".NET", "Aspose.Words.Node", assemblyPath).Init("#somepath##somefile#.doc");
// Unable to find a constructor for class Aspose.Words.DocumentBuilder that accepts parameters of type ( java.lang.String ).
CompositeNode=CreateObject(".NET", "Aspose.Words.CompositeNode", assemblyPath).Init();
//Unable to find a constructor for class Aspose.Words.Node that accepts parameters of type ( ‘’ ).
CompositeNode=CreateObject(".NET", "Aspose.Words.CompositeNode", assemblyPath).Init("#somepath##somefile#.doc");
// Unable to find a constructor for class Aspose.Words.DocumentBuilder that accepts parameters of type ( java.lang.String ).
DocumentBase=CreateObject(".NET", "Aspose.Words.DocumentBase", assemblyPath).Init("#somepath##somefile#.doc");
// Unable to find a constructor for class Aspose.Words.DocumentBase that accepts parameters of type ( java.lang.String ).
DocumentBase=CreateObject(".NET", "Aspose.Words.DocumentBase", assemblyPath).Init();
//Unable to find a constructor for class Aspose.Words.DocumentBase that accepts parameters of type ( ‘’ ).
doc=CreateObject(".NET", "Aspose.Words.Document", assemblyPath).Init();
//the above works
doc.Sections(0).PageSetup.SectionStart = Aspose.Words.SectionStart.Continuous;
//The Sections method was not found.
Section=CreateObject(".NET", "doc.Section");
//Class doc.Section not found in the specified assembly list.
Section=CreateObject("component", "doc.Section");
//Could not find the ColdFusion component or interface doc.Section.
section = doc.FirstSection;
//Element FIRSTSECTION is undefined in DOC.
headersFooters = doc.FirstSection.HeadersFooters;
//Element FIRSTSECTION.HEADERSFOOTERS is undefined in DOC.
section = doc.Section;
//Element SECTION is undefined in DOC.
doc.appendChild(section);
//Variable SECTION is undefined.
section = Section(doc);
//Variable SECTION is undefined.
section = new Section(doc);
//Could not find the ColdFusion component or interface Section.
//Section=doc.Sections(0);
//The Sections method was not found.
doc.Sections.Add(newSection);
//Element SECTIONS is undefined in DOC.
protocolDoc.Sections(0).PageSetup.SectionStart = Aspose.Words.SectionStart.Continuous;
//The Sections method was not found.
section = protocolDoc.getSections().get(0);
//The getSections method was not found.
I am able to create the Document:
<cfset protocolDoc=CreateObject(".NET", "Aspose.Words.Document", assemblyPath).Init()>
<cfset doc=CreateObject(".NET", "Aspose.Words.Document", assemblyPath).Init("#somepath##somefile#.doc")>
But once I create it, I cannot access any of its properties or methods, as shown in the Aspose.Words.chm for .NET manual. I’m still trying to get sections, ranges, insert headers and footers,
find/replace, insert bar code, etc. to work. If you have any ideas,
please let me know.
In
addition to .Section, .Sections(0), and .FirstSection, can you also
please check how I can access .Range, Header,
Footer, HEADERSFOOTERS, and how to add a bar code from a .png or .jpg
file? Also, find/replace text within a section or range, header or
footer.
Please keep me updated as you find out solutions to this.