创建发送电子邮件的 Infopath 表单

发布于 2024-11-09 16:29:38 字数 963 浏览 1 评论 0原文

我试图将最终用户在 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)

I am trying to include the text written by enduser in a textfield in an InfopathForm (textfield,multiline,paragraphbreaks and scroll bar if necessary) in an email to the relevant Department.

I always get this error "The name 'remarkmain' does not exist in the current context"

these are some parts of the code i used to define and include in mail:

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";

I am new to c# and this form i m creating in Infopath ( 2007 )

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

天暗了我发光 2024-11-16 16:29:38

您是否考虑过将某些值提交到表单库并通过 sharepoint 设计器使用 sharepoint 工作流程来发送邮件?共享点工作流程变量选择和通用界面通常是广阔而令人愉快的,并且功能广泛。

Have you considered submitting certain values to a form library and using sharepoint workflows via sharepoint designer to send the mail? The sharepoint workflow variable selection and general interface is generally expansive and pleasant and the functionality is extensive.

你怎么这么可爱啊 2024-11-16 16:29:38

确保 strign BodyAcc="New Internal Employee+....remarkmain+....; 位于 remarkmain 范围内

如果字符串连接过多,请使用 StringBuilder

StringBuilder BodyAcc = new StringBuilder
BodyAcc.Append(New Internal Employee);
BodyAcc.Append("\n");
BodyAcc.Append(remarkmain);

See to that strign BodyAcc="New Internal Employee+....remarkmain+....; is in remarkmain scope

Use StringBuilder if you have too many string concatinations

StringBuilder BodyAcc = new StringBuilder
BodyAcc.Append(New Internal Employee);
BodyAcc.Append("\n");
BodyAcc.Append(remarkmain);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文