Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to reference DLL component in C # code for QM2
#1
In qm3, it is very easy to create a doc document with the following code, It refers to GemBox.Document.dll  component
note:
Set DLL path: C:\Users\Administrator\Desktop\GemBox.Document.dll
Set Doc path: C:\Users\Administrator\Desktop\hello.docx

How to reference DLL component in C # code for QM2? Thanks in advance

In addition, how to generate DLL, exe,  code formatting? in qm3

Qm3 is very good and promising
Smile

QM3 code:

C# code:
// script "doc_cs.cs" /*/ r C:\Users\Administrator\Desktop\GemBox.Document.dll; /*/ //.
using Au; using System; using GemBox.Document;
partial class Script : AScript { [STAThread] static void Main(string[] a) => new Script(a); Script(string[] args) { //;;;


        // If using Professional version, put your serial key below.
        ComponentInfo.SetLicense("FREE-LIMITED-KEY");

        DocumentModel document = new DocumentModel();

        Section section = new Section(document);
        document.Sections.Add(section);

        Paragraph paragraph = new Paragraph(document);
        section.Blocks.Add(paragraph);

        Run run = new Run(document, "Hello World!");
        paragraph.Inlines.Add(run);

        document.Save(@"C:\Users\Administrator\Desktop\hello.docx");


}
}

QM2 Code:

Macro M3
Trigger A3     Help - how to add the trigger to the macro
Code:
Copy      Help
CsScript x.AddCode("")

x.Call("Program.Main")


#ret
using GemBox.Document;

class Program
{
,static void Main()
,{
,,// If using Professional version, put your serial key below.
,,ComponentInfo.SetLicense("FREE-LIMITED-KEY");

,,DocumentModel document = new DocumentModel();

,,Section section = new Section(document);
,,document.Sections.Add(section);

,,Paragraph paragraph = new Paragraph(document);
,,section.Blocks.Add(paragraph);

,,Run run = new Run(document, "Hello World!");
,,paragraph.Inlines.Add(run);

,,document.Save(@"C:\Users\Administrator\Desktop\hello.docx");
,}
}


Attached Files
.zip   GemBox.Document.dll.zip (Size: 1.25 MB / Downloads: 174)


Messages In This Thread
How to reference DLL component in C # code for QM2 - by macman - 01-06-2021, 04:32 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)