Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
Using PowerShell
>
General PowerShell
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.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
Mad_Matter
New Member
Posts:2
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 Stacanov
New Member
Posts:15
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.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
Using PowerShell
>
General PowerShell
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2