我试图在发送给相关部门的电子邮件中将enduser写入的文本包含在InfopathForm的文本字段中(文本字段,多行,段落和滚动条,如有必要)。
我总是收到此错误“当前上下文中不存在名称'remarkmain'”
这些是我用来定义和包含在邮件中的代码的一些部分:
string remarkmain = xnMyForm.SelectSingleNode("/my:myFields/my:field104", ns).Value;
string BodyAcc = "New Internal Employee " + Titlee + " " + fullname + ".\n Employee is joining " + Comp + " as of " + HireDate + ".\n\n Please view the general information below:\n " + bodyHD + "\n" + bodyED + "\n" + bodyDOB + "\n" + bodytitle + "\n" + bodylast + "\n" + bodyname + "\n" + bodyLang + "\n" + bodyComp + "\n" + bodydep + "\n" + bodyPos + "\n" + Bankacc + "\n" + add + "\n" + CostCtreVZW + "\n" + CostCtreCVBA + "\n\nWork Schedule\n" + WorkMon + "\n" + WorkTue + "\n" + WorkWed + "\n" + WorkThurs + "\n" + WorkFri + "\n" + WorkFDSch + "\n\n" + ContractN + "\n" + EmpN + "\n" + MGR + "\n" + Teamlead +"\n\n" **+ remarkmain** + "\n\n";
我是c#的新手,我在Infopath(2007)创建了这种形式
答案 0 :(得分:0)
您是否考虑过向表单库提交某些值并通过sharepoint designer使用sharepoint工作流来发送邮件? sharepoint工作流变量选择和通用界面通常是广泛和愉快的,功能是广泛的。
答案 1 :(得分:0)
请参见strign BodyAcc="New Internal Employee+....remarkmain+....;
范围内的remarkmain
如果字符串连接太多,请使用StringBuilder
StringBuilder BodyAcc = new StringBuilder
BodyAcc.Append(New Internal Employee);
BodyAcc.Append("\n");
BodyAcc.Append(remarkmain);