+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
How do you do....it? Thread, Print XML files in bulk in Technical; Word Options > Advanced > Untick "Confirm file format conversion on open"...
  1. #16

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,452
    Thank Post
    1,439
    Thanked 1,170 Times in 798 Posts
    Rep Power
    707
    Word Options > Advanced > Untick "Confirm file format conversion on open"

  2. #17

    Join Date
    Mar 2009
    Posts
    4
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks for the quick work around! But is this the only solution? The script must of messed up some settings?

    Regards

  3. #18

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    5,452
    Thank Post
    1,439
    Thanked 1,170 Times in 798 Posts
    Rep Power
    707
    Quote Originally Posted by ghu_ferry View Post
    Thanks for the quick work around! But is this the only solution? The script must of messed up some settings?

    Regards
    It's a very quick, simple fix, can't really get much easier than that!

  4. #19

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,968
    Thank Post
    673
    Thanked 1,383 Times in 1,145 Posts
    Rep Power
    350
    I've made a registry hack that seems to work for Windows 7 based on the hack that cache used on XP. More info in this thread:

    Right click to print multiple word docs

    It's been working, though i occasionally get random save 'normal.dotm' errors, but i don't think that's related to anything.

  5. #20

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,968
    Thank Post
    673
    Thanked 1,383 Times in 1,145 Posts
    Rep Power
    350
    Quote Originally Posted by ghu_ferry View Post
    This script worked but now whenever I try to open an XML file, Word prompts me with a list of options to convert the file! Any fix for this???
    Quote Originally Posted by LosOjos View Post
    Word Options > Advanced > Untick "Confirm file format conversion on open"
    Quote Originally Posted by ghu_ferry View Post
    Thanks for the quick work around! But is this the only solution? The script must of messed up some settings?

    Regards
    Quote Originally Posted by LosOjos View Post
    It's a very quick, simple fix, can't really get much easier than that!
    I just used that script today, from another thread where you reposted it @LosOjos , it does do something funny to convert settings. We're using Win7 with Office 2010. I guess the script was built for Office 2007, or it's just the way it's done, anyway, i fixed it on our setup with the following change to line 44:

    Code:
    myWord.Documents.Open filePath, False, True, False, , , False, , , 8, , True
    I forget which one, i think it's the fourth parameter that asks if you want to allow the converter for non word files. Changing it to false fixed it. Without it set, Word still opens the files fine as they are associated, and SIMS will print and preview okay (well, as well as it does) without a hidden prompt popping under.

    HTHs.

    @altecsole - great script by the way - does the trick and resolves the issue with the order of documents being muddled up, using any other bulk print method, such as putting in the right click context menu hack etc.

  6. 2 Thanks to vikpaw:

    altecsole (30th June 2011), LosOjos (30th June 2011)

  7. #21

    Join Date
    Jun 2012
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Print XML files in Bulk using InfoPath using Powershell

    Just wanted to put this on as I ran into this situation trying to convert the Infopath xml docs into a PDF writer.

    I tried the right click print registry hack and modified it to open Infopath instead of Word. This ultimately failed due to the lack of switches I could find that would allow Infopath to open print close.

    I tried the Bulk print vbs script on here. This did what it was supposed to but Word only pulls the XML raw code not the Infopath forms so it was not what i needed.


    Finally I stumbled on a Powershell scritpt that works Perfectly. Credit here bsonposh .com /archives /468 /BSonPoSH


    Printing Multiple InfoPath forms


    Install details for novice users
    Copy the Text between the dashed lines into Notepad. Then change the line containing "\\sharepoint.corp.com\Form_Folder" to the location of the folder needing converted for example "c:\sharepoint\Forms"
    Close and Save the notepad. Now rename the .txt extention to ps1. Double Click and your off and running. FYI should you need to edit the PS1 file, Right Click Edit. The script will automatically launch the Powershell interface which you can edit in as well.


    * Note if you are converting to PDF you will need a PDF writer set as the default printer. Your pdf printer should be configured to print out using the same name as the current name in Infopath so everything is kept orderly. Test on a small folder before trying a big converson.

    ---------------------------------------------------------------------------------------

    Param($Path = "\\sharepoint.corp.com\Form_Folder",[switch]$verbose)

    Write-Host

    function Invoke-FormPrint
    {
    Param($InfoForm)
    $shortname = $InfoForm.name
    Write-Verbose " – FormPrint: Creating COM Object"
    $infopath = New-Object -com InfoPath.Application -verbose:$false
    Write-Verbose " – FormPrint: Calling Open(`$InfoForm.fullname,10)"
    $infopath.XDocuments.Open($InfoForm.fullname,10) | out-null
    Write-verbose " – FormPrint: Calling PrintOut()"
    $infopath.XDocuments[0].printout()
    sleep 10
    Write-verbose " – FormPrint: Calling Quit()"
    $infopath.quit()
    if(!$?)
    {
    Write-Host " - Error printing Form: $shortname" -fore RED
    }
    else
    {
    Write-Host " - Successfully printed Form: $shortname" -fore Green
    }
    }

    $erroractionpreference = "silentlycontinue"

    if($verbose){$verbosepreference="continue";$errora ctionpreference="continue"}

    Write-Verbose " + Processing all Forms from: $path"
    $Forms = dir $path "*.xml"

    Write-Verbose " + $($Forms.count) Forms found"
    Write-host " + Processing all $($Forms.count) Forms located at: $path" -fore White

    foreach($Form in $Forms)
    {
    Write-Host " + Printing Form: $($Form.Name)" -fore White
    Invoke-FormPrint $Form
    }


    -----------------------------------------------------------------------------------------------------------


    Windows 7 with Office 2010

  8. #22

    Join Date
    Apr 2013
    Location
    Nottingham
    Posts
    24
    Thank Post
    11
    Thanked 6 Times in 2 Posts
    Rep Power
    4
    Quote Originally Posted by Admiral208 View Post
    ok, I have found another strange way round this problem.

    In Word, click open, navigate to the folder where the xml files are and select them all. Click on tools and then there is an option to print.

    Shown that by one of the women in the office who now thinks she knows more about computers than me!! damn her!!

    I have exactly the same issue (I know this is an old thread, but I found it via google)...... I have no option to click on 'tools' when trying this option !

    Any tips or ideas ?

    Regards

    Phil

  9. #23

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,759
    Thank Post
    3,269
    Thanked 1,052 Times in 973 Posts
    Rep Power
    365
    @Admiral208 --> Not sure how related this is but thought I would post it up anyway, in windows 7 it restricts the amount of xml / pdf files to 15 that you can print in one go from the context menu, this can be adjusted in the registry, registry file as per below

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
    "ShellState"=hex:24,00,00,00,30,28,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
      01,00,00,00,12,00,00,00,00,00,00,00,22,00,00,00
    "CleanShutdown"=dword:00000000
    "Browse For Folder Width"=dword:0000013e
    "Browse For Folder Height"=dword:00000120
    "ExplorerStartupTraceRecorded"=dword:00000001
    "link"=hex:1e,00,00,00
    "MultipleInvokePromptMinimum"=dword:000001f4
    It is the "MultipleInvokePromptMinimum"=dword:000001f4

    Something similar to this post : Solved Printing - Windows 7 Help Forums

  10. #24

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,968
    Thank Post
    673
    Thanked 1,383 Times in 1,145 Posts
    Rep Power
    350
    Quote Originally Posted by bwfc_nottingham View Post
    I have exactly the same issue (I know this is an old thread, but I found it via google)...... I have no option to click on 'tools' when trying this option !

    Any tips or ideas ?

    Regards

    Phil
    I had the same issue - mentioned here Right click to print multiple word docs

    The same thread also has the hack @mac_shinobi mentions, - so it is relevant

    I would use one of the other solutions provided in either this or that thread. The benefit of the vbscript method is that it prints in order, which isn't necessarily the case when you select all and use the right click option. For us, printing in alphabetical order was a big deal as we collate other info with the reports before sending home.

  11. Thanks to vikpaw from:

    mac_shinobi (29th June 2013)

  12. #25

    Join Date
    Mar 2014
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I have tried this script numerous times, but it doesn't quite work. It opens the Infopath form, sleeps for 10 seconds, closes it, opens the next one, etc., and completes the script. But it is not actually printing the form. I've tried it by setting my default printer to PDF, or just leaving it as a real printer. By putting a -noexit command at the end, I can view the messages on the screen when the script is complete, and they state that the forms were printed successfully. I'm not getting any error messages.

    Am I doing something wrong? Once the Infopath form is displayed and open on the screen, it seems like the printing part would be easy. But I think the Printout() command is not working as expected.

    I'm using Windows 7 Pro at work, Powershell Version 1.0.

    Thanks for any advice!

  13. #26

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Saudi Arabia
    Posts
    5,968
    Thank Post
    673
    Thanked 1,383 Times in 1,145 Posts
    Rep Power
    350

    Does the printer icon go active?
    Maybe increase the sleep time and try a Ctrl+P in there manually, or the file menu method. Maybe something has changed in the syntax of the command.
    Never done this with infopath, or used that script.
    It might be possible to alter the vb version to open infopath instead of Word.

  14. #27

    Join Date
    Mar 2014
    Posts
    2
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks for the suggestions.

    No, the printer icon does not go active. No evidence of printing.

    What would be the Powershell script for getting into the file menu of Infopath and essentially instructing it to File, Print?

    There are definitely some differences between Infopath and other Microsoft files. The start-process command (with a file path and filename) works fine to open and print a Word document, but returns errors when the exact same code is used and an xml file is substituted.

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. [SIMS] Printing XML Files in Batch
    By mikeruddell2 in forum MIS Systems
    Replies: 11
    Last Post: 11th November 2010, 11:34 AM
  2. Replies: 4
    Last Post: 31st July 2009, 11:43 AM
  3. .XML Bulk conversion
    By Sylv3r in forum How do you do....it?
    Replies: 3
    Last Post: 2nd July 2009, 09:41 PM
  4. Help parsing XML files using VB
    By SimpleSi in forum Coding
    Replies: 5
    Last Post: 10th June 2009, 08:25 AM
  5. Search replace across multiple XML files
    By ajbritton in forum Windows
    Replies: 6
    Last Post: 6th April 2008, 11:07 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •