Icetips News Network
News & BiosArchivesIcetips Software ProductsAbout Icetips.net
 
Using Word Previewer with Icetips Preveiwer

 
One of our customer, Bob Campbell, has successfully implemented our Icetips Previewer with the Winword Previewer from FominTools which opens the report in Microsoft Word for Windows.

Click to view fulsize screenshot (116K)
 

Bob was kind enough to provide us with the code he used and allow us to post it on the website. Bob created a button on the Icetips Previewer window and added the following code in the Accepted embed on the button:

 WinwordPreview(pImageQueue,,|
               '.\Report.doc', |
               'Save File and Preview',|
               'Overwrite Existing File')
  
Obviously you need to have the Winword Previewer templates for this to work.

This will pass the whole report to the Winword Previewer as internally the Icetips Previewer does not manipulate the queue passed to it from the report until the Previewer is closed. If you want to take advantage of the tagging in the Icetips Previewer and only send the tagged pages to the Word Previwer, you would need to use code similar to what is in the MoveQueueFromLocal routine in the Icetips Perviewer procedure. You could write this something like this:

 Free(pImageQueue)
 Loop I# = 1 To ITP:TotalPages
   Get(ITP:PageQueue,I#)
   If ITP:PageQueue.ITP:PQ:PrintPage
     pImageQueue = ITP:PageQueue.ITP:PQ:WmfFile
     Add(pImageQueue)
   End
 End
 WinwordPreview(pImageQueue,,|
               '.\Report.doc', |
               'Save File and Preview',|
               'Overwrite Existing File')

  
First we free the queue that was passed to the previewer as it is now being maintained by the local queue. Then we simply step through the local queue (ITP:PageQueue) and add the pages that are tagged to be printed to the pImageQueue, and finally we use Bob's code to pass the pImageQueue to the Word Previewer. If you would only want to send the current page to the Word Previewer, you could do it like this:
 Free(pImageQueue)
 Get(ITP:PageQueue,ITP:CurrentPage)
 If ITP:PageQueue.ITP:PQ:PrintPage
   pImageQueue = ITP:PageQueue.ITP:PQ:WmfFile
   Add(pImageQueue)
 End
 WinwordPreview(pImageQueue,,|
               '.\Report.doc', |
               'Save File and Preview',|
               'Overwrite Existing File')

  
Again we simply move this record to the pImageQueue and pass it on to the Word Previewer.

We thank Bob for contributing his code and screenshot:)