header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Need to automate file rename, raw text to .doc, Word macro processing
Last Post 11 Aug 2010 02:30 AM by Mihail Stacanov. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Mad_MatterUser is Offline
New Member
New Member
Posts:2
Avatar

--
30 Jul 2010 12:17 PM
    Hi, I'm a totally new to PowerShell although I've used BASH for something similar in the past. I'm trying to automate a very repetitive task for an employee. She gets raw text files which she then manually converts to .doc, processes with a Word macro, and saves them with a name that is in the document. Is it possible to do all with PowerShell or the like? If so what cmdlets or external programs could be used to accomplish this? Thanks in advance.
    Mihail StacanovUser is Offline
    New Member
    New Member
    Posts:15
    Avatar

    --
    11 Aug 2010 02:30 AM
    #You can use this script
    $name = (Get-Content d:\Text.txt | Select -first 1)
    [Void] [Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Interop.Word")
    $MSWord = New-Object -com word.application
    $document = $MSWord.documents.open("d:\Text.txt")
    #$MSWord.Run("Macro")
    $document.saveas([ref]"d:\$name.doc")
    $document.Close()
    $MSWord.Application.Quit()
    http://proproit.com
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer