Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
A1sysman A1sysman is offline
external usenet poster
 
Posts: 6
Default W2003, batch converter wizard - can it be ran from the command lin

Hi,

Working with Word 2003. I have installed the batch converter wizard and all
is well.

I would like to create a batch file that opens Word, calls the wizard and
runs with a defined configuration, eg convert Word doc to xml, predefined
source and target folders, select all.

I can run a batch file to open the wizard, thus..

echo off
"C:\Program Files\Microsoft Office\Templates\1033\Batch Conversion Wizard.Wiz"

.... but I am still faced with manually selecting conversion type, sourc e
and target folders, select all.

I tried recording a macro calling the wizard and defining the settings - no
luck, all the macro contained was a call to the wizard.

Any ideas please?

Thanks

N
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default W2003, batch converter wizard - can it be ran from the command lin

The following Word macro will do much the same

Sub SaveAllAsXML()
Dim strFilename As String
Dim strDocName As String
Dim strPath As String
Dim oDoc As Document
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)

With fDialog
.Title = "Select folder and click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show -1 Then
MsgBox "Cancelled By User", , "List Folder Contents"
Exit Sub
End If
strPath = fDialog.SelectedItems.Item(1)
If Right(strPath, 1) "\" Then strPath = strPath + "\"
End With

If Documents.Count 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If
If Left(strPath, 1) = Chr(34) Then
strPath = Mid(strPath, 2, Len(strPath) - 2)
End If
strFilename = Dir$(strPath & "*.doc")

While Len(strFilename) 0
Set oDoc = Documents.Open(strPath & strFilename)

strDocName = ActiveDocument.FullName
intPos = InStrRev(strDocName, ".")
strDocName = Left(strDocName, intPos - 1)
strDocName = strDocName & ".xml"
oDoc.SaveAs FileName:=strDocName, _
FileFormat:=wdFormatXML
oDoc.Close SaveChanges:=wdDoNotSaveChanges
strFilename = Dir$()
Wend
End Sub

http://www.gmayor.com/installing_macro.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"A1sysman" wrote in message
...
Hi,

Working with Word 2003. I have installed the batch converter wizard and
all
is well.

I would like to create a batch file that opens Word, calls the wizard and
runs with a defined configuration, eg convert Word doc to xml, predefined
source and target folders, select all.

I can run a batch file to open the wizard, thus..

echo off
"C:\Program Files\Microsoft Office\Templates\1033\Batch Conversion
Wizard.Wiz"

... but I am still faced with manually selecting conversion type, sourc e
and target folders, select all.

I tried recording a macro calling the wizard and defining the settings -
no
luck, all the macro contained was a call to the wizard.

Any ideas please?

Thanks

N



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch Conversion Wizard ArmyMom87 Microsoft Word Help 3 August 5th 09 06:36 AM
Batch Conversion Wizard in 2007? Joyce Microsoft Word Help 1 May 24th 08 06:53 AM
batch conversion wizard preeto New Users 7 December 21st 06 06:21 PM
batch conversion wizard preeto New Users 0 December 19th 06 11:34 AM
Batch Conversion Wizard Kent Gorsuch Microsoft Word Help 0 January 12th 06 01:25 PM


All times are GMT +1. The time now is 03:59 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"