ApplicationClass LBL=new ApplicationClass ();
Try
{
LBL. Documents. Open (@ ";" , false);
//the Document doc=new Document ();
Document doc=LBL. ActiveDocument;
Doc. Variables. FormVariables. Item (variable "0"). The Value=https://bbs.csdn.net/topics/textBox1.Text.Trim ();
Doc. Variables. FormVariables. Item (" 1 "variable). Value=" https://bbs.csdn.net/topics/1234325435465676576876876 ";
Doc. PrintDocument (1);
Doc. Close (false);
}
The catch (Exception ex)
{
MessageBox. Show (ex. Message);
LBL. Quit ();
}
CodePudding user response:
Doc. Variables. FormVariables=null!His breaking point and have a look, don't interrupt point?
https://jingyan.baidu.com/article/cb5d6105e6309c005c2fe0f5.html
CodePudding user response:
This kind of problem, a breakpoint can solve,CodePudding user response:
Using breakpoint test also found before the sentence is empty, but I don't know why it is empty,CodePudding user response:
Error in where?CodePudding user response:
Error in this line of doc. Variables. FormVariables. Item (variable "0"). Value=https://bbs.csdn.net/topics/textBox1.Text.Trim ();Now I only know that the Variables it is a COM object, COM objects are unable to extract which contains the variable name?
CodePudding user response: