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 2008

Tip: Looking for answers? Try searching our database.

Output muliple views to PDF

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Humphrey - 02 Jan 2008 12:46 GMT
I'm getting there...

I'm trying to iterate between all the views in the form and print each view
to PDF via code.

           allViews = Me.ViewInfos

           For a = 0 To allViews.Count - 1
               strViewName = Me.ViewInfos(a).Name
               Me.ViewInfos.SwitchView(strViewName)
....
           Next
The code itself seems to work in that it will select the name of each of the
views in turn in the strViewName variable, however the switchview only works
for the first item through the loop.  In this case it is the data entry view.
The data presentation views are never selected.
What am I missing here?  I read somewhere you can only change the view once
in code but this would not make sense.  Any help would be appreciated.

H
Greg Collins - 02 Jan 2008 23:58 GMT
Your not missing anything... there can only be one view switch at a time.
View switching while another view switch is going on is not allowed. A view
switch is not complete until all code has finished, etc, and the view
finishes drawing itself.

You might look into the OnContextChange event handler and write some code in
there to perform what you want. A context change occurs after the view
switch is complete.

Signature

Greg Collins
Microsoft MVP
Visit Braintrove at http://www.braintrove.com
Visit InfoPathDev at http://www.infopathdev.com

 
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.