Hi,
You should be able to use code similar to the following on the click event
of a button - this is VBScript:
Dim objEmail
XDocument.View.SwitchView("vwPrint")
Set objEmail = Application.ActiveWindow.MailEnvelope
objEmail.Subject = "Test e-mail message"
objEmail.Visible = true
**NOTE: When you use this method, everything you see in the View appears in
the mail. As such, I created a "print view" (vwPrint) that only shows the
data and not all of the buttons. In this manner, I first switch to that
view and then create the e-mail from that "active window."
I hope this helps!
Best Regards,
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights
VicMan23228 - 20 Jun 2005 23:28 GMT
Hello Scott,
Thank you for the feed back.
Please note that I was already doing this. The problem lies after the view
has changed and the email generated. In fact it only arises when I send the
email.
Let me see if I can explain it better.
When I hit the button in my form it switches Views calls Outlook 2003 and
preps the email completely. Now in that Outlook email window (Auto Generated
by InfoPath) I hit the send button and finally the email is sent.
All looks well until I receive what the customer actually got.
1) The email as I wanted him to see it.
2) PLUS a file attached to that email called form1.xml
That is the file I don’t want them to get. If I open this file it contains
all of my views, code and everything else. When I only wanted the user to get
the results of the one view nothing else. This means that the user can open
the xml file switch views and see everything we did in the back end to
generate the notification. Some of this stuff is confidential and should not
be seen by the customer at all.
To see this in action take a look at one of the built in templates in
InfoPath called Issue Tracking (Simple)
Create a second view just for testing.
Complete the Main view of the form and hit the button labeled "Send as Email".
See how it creates a form that is identical to that of an Outlook Email.
Also note that by default there are no attachments listed. Now send that
email to your self.
Look at the resulting email you received and the file that it attached while
the email was being sent.
Save that file attachment to your desktop. Now load it into InfoPath. See
you have everything you originally had including all of the diferent views.
I don’t want that just the view I submitted with and nothing else.
Any Ideas on how to prevent this file attachment or control it / lock it
down so that the end user does not get access to confidential information
with in other views in the form?
Thank you for your valuable time.
VicMan23228
Scott L. Heim [MSFT] - 21 Jun 2005 14:08 GMT
Hi,
Sorry for the misinformation - you are correct...the attachment is still
there and I have found there is no real viable way to send mail without the
attachment.
There is a "manual" method:
- Go offline first (disconnect from the network)
- Send the mail
- Go into your Outlook Outbox and delete the attachment from the mail
message.
- Come back online and the mail will be sent with no attachment.
But as you can see this is "user intensive." So at this point there does
not appear to be a way to accomplish what you need.
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights
VicMan23228 - 21 Jun 2005 15:51 GMT
Humm and there is not way to do these exact same steps programaticly?

Signature
VicMan23228
> Hi,
>
[quoted text clipped - 17 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 21 Jun 2005 17:59 GMT
Hi,
Unfortunately none that I have found.
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights
Adam Harding - 01 Nov 2005 14:38 GMT
If i understand correctly there is no programming needed.
I send receipts without attachnig the form by deleting the word 'form' from
the email setup box, this works a treat.
> Humm and there is not way to do these exact same steps programaticly?
>
[quoted text clipped - 19 lines]
> >
> > This posting is provided "AS IS" with no warranties, and confers no rights