T
Travis Lauricella
I'm not an "official" programmer, but for the last seven years I've
tinkered with Word and Excel's VBA enough to become pretty proficient
at submitting them through Outlook to other users. My preferred
method was Word's routing slip (edited to save space):
ActiveDocument.RoutingSlip.AddRecipient "(e-mail address removed)"
ActiveDocument.RoutingSlip.Subject = "Some subject"
ActiveDocument.Route
When this wasn't possible, I used MAPI calls (again, edited to save
space):
ActiveDocument.SaveAs cstrFileName
Set objSession = CreateObject("mapi.session")
Set objMessage = objSession.Outbox.Messages.Add
Set objOneRecip = objMessage.Recipients.Add
objOneRecip.Name = cstrRecipientName
objMessage.Subject = cstrSubject
objMessage.Text = ActiveDocument.FormFields("somefield").Result
Set objAttachment = objMessage.Attachments.Add
objAttachment.Type = 1
objAttachment.ReadFromFile cstrFileName
objAttachment.Source = cstrFileName
objMessage.Update
objMessage.Send
A method that I never use, because of the need to keep the form and
data integrity once the user clicks the "Send" button, is to do a
simple ActiveDocument.SendMail, because that gives the user the
opporunity to mess with the attachment (or inline text) after the
validation is done.
I'm really excited about the capabilities of InfoPath, and am trying
it out today for the first time. I know nothing about Web Services,
although I've poked around a little bit at our CDONTS server. The
only effective custom script I've been able to find was the one Andrew
Watt posted here back in April:
var objEmail;
objEmail = Application.ActiveWindow.MailEnvelope;
objEmail.To = "(e-mail address removed)";
objEmail.CC = "(e-mail address removed)"
objEmail.Subject = "The user must choose to send this";
objEmail.Visible = true;
Unfortunately, this displays an XML attachment and and editable HTML
representation of the form in the Outlook message before the user
chooses "Send" in the Outlook window.
I guess what I'm really looking for is a way to click an InfoPath
"Submit" button to send the InfoPath file to "(e-mail address removed)",
without giving the sender an opportunity to edit it between clicking
"Submit" and the time it's sent. (Yes, I know they could delay
Outlook's sending, and plenty of other ways, but my goal is more to
protect curious users from themselves, rather than true security.)
I'd appreciate any ideas you've got.
Travis
tinkered with Word and Excel's VBA enough to become pretty proficient
at submitting them through Outlook to other users. My preferred
method was Word's routing slip (edited to save space):
ActiveDocument.RoutingSlip.AddRecipient "(e-mail address removed)"
ActiveDocument.RoutingSlip.Subject = "Some subject"
ActiveDocument.Route
When this wasn't possible, I used MAPI calls (again, edited to save
space):
ActiveDocument.SaveAs cstrFileName
Set objSession = CreateObject("mapi.session")
Set objMessage = objSession.Outbox.Messages.Add
Set objOneRecip = objMessage.Recipients.Add
objOneRecip.Name = cstrRecipientName
objMessage.Subject = cstrSubject
objMessage.Text = ActiveDocument.FormFields("somefield").Result
Set objAttachment = objMessage.Attachments.Add
objAttachment.Type = 1
objAttachment.ReadFromFile cstrFileName
objAttachment.Source = cstrFileName
objMessage.Update
objMessage.Send
A method that I never use, because of the need to keep the form and
data integrity once the user clicks the "Send" button, is to do a
simple ActiveDocument.SendMail, because that gives the user the
opporunity to mess with the attachment (or inline text) after the
validation is done.
I'm really excited about the capabilities of InfoPath, and am trying
it out today for the first time. I know nothing about Web Services,
although I've poked around a little bit at our CDONTS server. The
only effective custom script I've been able to find was the one Andrew
Watt posted here back in April:
var objEmail;
objEmail = Application.ActiveWindow.MailEnvelope;
objEmail.To = "(e-mail address removed)";
objEmail.CC = "(e-mail address removed)"
objEmail.Subject = "The user must choose to send this";
objEmail.Visible = true;
Unfortunately, this displays an XML attachment and and editable HTML
representation of the form in the Outlook message before the user
chooses "Send" in the Outlook window.
I guess what I'm really looking for is a way to click an InfoPath
"Submit" button to send the InfoPath file to "(e-mail address removed)",
without giving the sender an opportunity to edit it between clicking
"Submit" and the time it's sent. (Yes, I know they could delay
Outlook's sending, and plenty of other ways, but my goal is more to
protect curious users from themselves, rather than true security.)
I'd appreciate any ideas you've got.
Travis