Dim dr As DataRow = e.DataRow If dr("交款方") = Nothing Then MessageBox.Show("交款方不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) e.Cancel = True Else e.FileName = dr("收据编号") & dr("交款方") & dr("金额") & ".pdf" e.SubFolder = dr("交款方") End If '按"交款方"在Attachments文件夹目录下面自动生成专属于客户项目的文件夹!