Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2007

Tip: Looking for answers? Try searching our database.

Save and email with one button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jody frazier - 06 Mar 2007 20:38 GMT
I would like to have 1 button that would email the form and save it to the
same location when clicked.  Right now I'm accomplishing this with using a
"email button" with the data connection attached to it to email my form and
then a "save button" to save the form to the same location.  I would like to
combine the 2 if possible.  Of course I don't have code for the email since
I'm using a data connection for that but here is my code to save the form to
the default location:

Sub CTRL2_9_OnClick(eventObj)
Dim txtPath
Dim txtName
Dim GMSRef

GMSRef = XDocument.DOM.selectSingleNode("my:myFields/my:JobNum").text
txtPath = "C:\My Documents\InfoPath Forms\"
txtName = ".xml"

XDocument.SaveAs(txtpath & GMSRef & txtName)

thisXDocument.Application.Close(true)
End Sub

Any ideas anyone?
Signature

Thanks!
Jody

S.Y.M. Wong-A-Ton - 07 Mar 2007 23:15 GMT
Have you already tried putting the rule to send the email on the Save button?
You can define both on the Save button; the only thing is that the rule will
run before the code, so the email sent before the save takes place.
---
S.Y.M. Wong-A-Ton

> I would like to have 1 button that would email the form and save it to the
> same location when clicked.  Right now I'm accomplishing this with using a
[quoted text clipped - 19 lines]
>
> Any ideas anyone?
jody frazier - 15 Mar 2007 17:19 GMT
No I haven't tried that yet.  How do I go about doing that?  I'm very new 2
InfoPath...
Signature

Thanks!
Jody

> Have you already tried putting the rule to send the email on the Save button?
> You can define both on the Save button; the only thing is that the rule will
[quoted text clipped - 25 lines]
> >
> > Any ideas anyone?
S.Y.M. Wong-A-Ton - 19 Mar 2007 08:06 GMT
Did you add the save button to the form yourself? Or are you using the save
button in the toolbar?

If you did the first, you can add a rule to the save button just like you
did for the email button. Double-click on the button, click on the Rules
button, and add a Rule with an Action that says: Submit using a data
connection. And use the email data connection you created.

If you used the latter, you'll have to add code to the code you've already
written (use an EmailAdapter for this; see
http://msdn2.microsoft.com/en-us/library/aa167746(office.11).aspx for an
example on how to do this).

From the code you provided previously it does not look like you're using the
save button in the toolbar, so the first method should work.
---
S.Y.M. Wong-A-Ton

> No I haven't tried that yet.  How do I go about doing that?  I'm very new 2
> InfoPath...
[quoted text clipped - 28 lines]
> > >
> > > Any ideas anyone?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.