+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
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
    3,685
    Thank Post
    980
    Thanked 696 Times in 494 Posts
    Rep Power
    381
    Word Options > Advanced > Untick "Confirm file format conversion on open"

  2. IDG Tech News
  3. #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

  4. #18

    LosOjos's Avatar
    Join Date
    Dec 2009
    Location
    West Midlands
    Posts
    3,685
    Thank Post
    980
    Thanked 696 Times in 494 Posts
    Rep Power
    381
    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!

  5. #19

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Jeddah, Saudi Arabia
    Posts
    5,216
    Thank Post
    481
    Thanked 1,056 Times in 889 Posts
    Rep Power
    285
    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.

  6. #20

    vikpaw's Avatar
    Join Date
    Sep 2006
    Location
    Jeddah, Saudi Arabia
    Posts
    5,216
    Thank Post
    481
    Thanked 1,056 Times in 889 Posts
    Rep Power
    285
    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.

  7. 2 Thanks to vikpaw:

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

  8. #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

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
  •