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 / January 2007

Tip: Looking for answers? Try searching our database.

Submit and print with one button and rules

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeffshex - 20 Jun 2005 17:35 GMT
I have a status report form.  Is it possible to not only submit to the
database...but also if there hours for the week are under 35, to print it out
automatically?
I know this will need script... I just need an example or walk through to
help me out here.

Thanks!
Scott L. Heim [MSFT] - 20 Jun 2005 18:42 GMT
Hi,

You can use this code (vbscript) on the click event of your button:

    XDocument.Submit
    XDocument.Printout

** NOTE: This will require your form to be "Fully Trusted."

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Jeffshex - 20 Jun 2005 18:50 GMT
I seen where I can click that over to Fully Trusted.
Is this a good or bad thing if I do that?
I'm not quite sure what "Fully Trusted" will get me into.

Thanks.

> Hi,
>
[quoted text clipped - 11 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 20 Jun 2005 19:03 GMT
Hi,

It means that you will either need to "digitally sign" your solution using
a digital certificate or create an installable package (using the Regform
tool from the InfoPath SDK) that sets the form to "Full Trust" and then
each user will need to install your form.

Here is some additional information that you may find of interest:

Understanding Fully Trusted Forms
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/
ipsdkUnderstandingFullyTrustedForms.asp

Using the Form Registration Tool
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/
ipsdkUsingTheFormRegistrationTool.asp

InfoPath SDK
http://www.microsoft.com/downloads/details.aspx?FamilyId=351F0616-93AA-4FE8-
9238-D702F1BFBAB4&displaylang=en

I hope this helps you!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Jeffshex - 20 Jun 2005 19:09 GMT
Is this code going to print out everything though?  Or am i able to throw on
a statement to print only forms less than 35 hours?

Thanks again.
Your help is greatly appreaciated.

> Hi,
>
[quoted text clipped - 25 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 20 Jun 2005 19:27 GMT
Hi,

This is going to print everything that is on the View. As such, you will
need to control what appears on the view. Keep in mind, this is doing the
same thing as manually executing the print. So if your current view works
fine, then you don't need to change anything other than using code to
execute the submit and print.

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Jeffshex - 20 Jun 2005 19:36 GMT
Scott,

It's ok if i print everything on view, i'm not worried about that.  I have a
field at the bottom of the form called WeekTotal.  Every form should submit
(like it normally does), but I guess i'm wanting the code to say something
like: "Print only if WeekTotal < 35".

Thanks again.

> Hi,
>
[quoted text clipped - 8 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 20 Jun 2005 20:36 GMT
Hi,

Then in that case, you should be able to place the call to print in an "If"
test - use the "selectSingleNode" method to get a reference to that control
and then if the value is < 35, call the PrintOut method.

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
JB - 30 Jan 2007 03:36 GMT
This is exactly what I want done. However I don't know how to create the
script on the button. I tried the below code but no luck.

XDocument.Submit
    XDocument.Printout

How do I insert the above code?
Signature

Jesse

> Hi,
>
[quoted text clipped - 11 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights

Rate this thread:






 
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.