WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Need VB code to batch convert wps

 
Goto page 1, 2
   Home -> Office -> Conversions RSS
Next:  break column  
Author Message
Bill

External


Since: Dec 20, 2007
Posts: 7



(Msg. 1) Posted: Thu Jul 09, 2009 10:35 pm
Post subject: Need VB code to batch convert wps
Archived from groups: microsoft>public>word>conversions (more info?)

Anyone have some VB code suitable for
use with Word 2003 that can used to
batch convert a folders worth of wps
files to Word documents?

Thanks,
Bill
Back to top
Login to vote
Graham Mayor

External


Since: Jul 04, 2006
Posts: 8385



(Msg. 2) Posted: Fri Jul 10, 2009 4:05 am
Post subject: Re: Need VB code to batch convert wps [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

For Word 2007, there's an add-in that you can download from my web site.
For Word 2003, the following should do the trick PROVIDED you have the the
appropriate Works converter installed. You can download missing Works
converters from my web site

Sub SaveAllAsDoc()
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", , "Save all"
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
strFileName = Dir$(strPath & "*.wps")
While Len(strFileName) <> 0
Set oDoc = Documents.Open(strPath & strFileName)
strDocName = ActiveDocument.FullName
intPos = InStrRev(strDocName, ".")
strDocName = Left(strDocName, intPos - 1)
strDocName = strDocName & ".doc"
oDoc.SaveAs FileName:=strDocName, _
FileFormat:=0
oDoc.Close SaveChanges:=wdDoNotSaveChanges
strFileName = Dir$()
Wend
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

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


Bill wrote:
> Anyone have some VB code suitable for
> use with Word 2003 that can used to
> batch convert a folders worth of wps
> files to Word documents?
>
> Thanks,
> Bill
Back to top
Login to vote
Bill

External


Since: Dec 20, 2007
Posts: 7



(Msg. 3) Posted: Fri Jul 10, 2009 8:45 am
Post subject: Re: Need VB code to batch convert wps [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks Graham, I'll have access to my client's
machine later this evening and I'll run your code.
Are there any special VB References required
for objects you've used?
Bill


"Graham Mayor" <gmayor.RemoveThis@REMOVETHISmvps.org> wrote in message
news:eU6$q2SAKHA.3556@TK2MSFTNGP04.phx.gbl...
>
> For Word 2007, there's an add-in that you can download from my web site.
> For Word 2003, the following should do the trick PROVIDED you have the the
> appropriate Works converter installed. You can download missing Works
> converters from my web site
>
> Sub SaveAllAsDoc()
> 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", , "Save all"
> 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
> strFileName = Dir$(strPath & "*.wps")
> While Len(strFileName) <> 0
> Set oDoc = Documents.Open(strPath & strFileName)
> strDocName = ActiveDocument.FullName
> intPos = InStrRev(strDocName, ".")
> strDocName = Left(strDocName, intPos - 1)
> strDocName = strDocName & ".doc"
> oDoc.SaveAs FileName:=strDocName, _
> FileFormat:=0
> oDoc.Close SaveChanges:=wdDoNotSaveChanges
> strFileName = Dir$()
> Wend
> End Sub
>
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
> Bill wrote:
>> Anyone have some VB code suitable for
>> use with Word 2003 that can used to
>> batch convert a folders worth of wps
>> files to Word documents?
>>
>> Thanks,
>> Bill
>
>
Back to top
Login to vote
Graham Mayor

External


Since: Jul 04, 2006
Posts: 8385



(Msg. 4) Posted: Sat Jul 11, 2009 1:05 am
Post subject: Re: Need VB code to batch convert wps [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

It should work with the default settings.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

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


Bill wrote:
> Thanks Graham, I'll have access to my client's
> machine later this evening and I'll run your code.
> Are there any special VB References required
> for objects you've used?
> Bill
>
>
> "Graham Mayor" <gmayor.RemoveThis@REMOVETHISmvps.org> wrote in message
> news:eU6$q2SAKHA.3556@TK2MSFTNGP04.phx.gbl...
>>
>> For Word 2007, there's an add-in that you can download from my web
>> site. For Word 2003, the following should do the trick PROVIDED you
>> have the the appropriate Works converter installed. You can download
>> missing Works converters from my web site
>>
>> Sub SaveAllAsDoc()
>> 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", , "Save all"
>> 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
>> strFileName = Dir$(strPath & "*.wps")
>> While Len(strFileName) <> 0
>> Set oDoc = Documents.Open(strPath & strFileName)
>> strDocName = ActiveDocument.FullName
>> intPos = InStrRev(strDocName, ".")
>> strDocName = Left(strDocName, intPos - 1)
>> strDocName = strDocName & ".doc"
>> oDoc.SaveAs FileName:=strDocName, _
>> FileFormat:=0
>> oDoc.Close SaveChanges:=wdDoNotSaveChanges
>> strFileName = Dir$()
>> Wend
>> End Sub
>>
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>>
>> Bill wrote:
>>> Anyone have some VB code suitable for
>>> use with Word 2003 that can used to
>>> batch convert a folders worth of wps
>>> files to Word documents?
>>>
>>> Thanks,
>>> Bill
Back to top
Login to vote
Bill

External


Since: Dec 20, 2007
Posts: 7



(Msg. 5) Posted: Sat Jul 11, 2009 1:05 am
Post subject: Re: Need VB code to batch convert wps [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I'll post back after I've had the opportunity to
access the troubled computer.
Bill

"Graham Mayor" <gmayor.DeleteThis@REMOVETHISmvps.org> wrote in message
news:unNx87dAKHA.5040@TK2MSFTNGP04.phx.gbl...
> It should work with the default settings.
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
> Bill wrote:
>> Thanks Graham, I'll have access to my client's
>> machine later this evening and I'll run your code.
>> Are there any special VB References required
>> for objects you've used?
>> Bill
>>
>>
>> "Graham Mayor" <gmayor.DeleteThis@REMOVETHISmvps.org> wrote in message
>> news:eU6$q2SAKHA.3556@TK2MSFTNGP04.phx.gbl...
>>>
>>> For Word 2007, there's an add-in that you can download from my web
>>> site. For Word 2003, the following should do the trick PROVIDED you
>>> have the the appropriate Works converter installed. You can download
>>> missing Works converters from my web site
>>>
>>> Sub SaveAllAsDoc()
>>> 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", , "Save all"
>>> 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
>>> strFileName = Dir$(strPath & "*.wps")
>>> While Len(strFileName) <> 0
>>> Set oDoc = Documents.Open(strPath & strFileName)
>>> strDocName = ActiveDocument.FullName
>>> intPos = InStrRev(strDocName, ".")
>>> strDocName = Left(strDocName, intPos - 1)
>>> strDocName = strDocName & ".doc"
>>> oDoc.SaveAs FileName:=strDocName, _
>>> FileFormat:=0
>>> oDoc.Close SaveChanges:=wdDoNotSaveChanges
>>> strFileName = Dir$()
>>> Wend
>>> End Sub
>>>
>>>
>>> --
>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>> Graham Mayor - Word MVP
>>>
>>> My web site www.gmayor.com
>>> Word MVP web site http://word.mvps.org
>>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>>
>>>
>>> Bill wrote:
>>>> Anyone have some VB code suitable for
>>>> use with Word 2003 that can used to
>>>> batch convert a folders worth of wps
>>>> files to Word documents?
>>>>
>>>> Thanks,
>>>> Bill
>
>
Back to top
Login to vote
Bill

External


Since: Dec 20, 2007
Posts: 7



(Msg. 6) Posted: Sun Jul 12, 2009 10:16 pm
Post subject: Re: Need VB code to batch convert wps [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Code worked great. Turned out that my
client had W2002 installed and inserting
your code in a general module and running
from Debug easily converted all 218 wps
files to doc files of the same name.

Many thanks.
Bill

"Graham Mayor" <gmayor RemoveThis @REMOVETHISmvps.org> wrote in message
news:eU6$q2SAKHA.3556@TK2MSFTNGP04.phx.gbl...
>
> For Word 2007, there's an add-in that you can download from my web site.
> For Word 2003, the following should do the trick PROVIDED you have the the
> appropriate Works converter installed. You can download missing Works
> converters from my web site
>
> Sub SaveAllAsDoc()
> 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", , "Save all"
> 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
> strFileName = Dir$(strPath & "*.wps")
> While Len(strFileName) <> 0
> Set oDoc = Documents.Open(strPath & strFileName)
> strDocName = ActiveDocument.FullName
> intPos = InStrRev(strDocName, ".")
> strDocName = Left(strDocName, intPos - 1)
> strDocName = strDocName & ".doc"
> oDoc.SaveAs FileName:=strDocName, _
> FileFormat:=0
> oDoc.Close SaveChanges:=wdDoNotSaveChanges
> strFileName = Dir$()
> Wend
> End Sub
>
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
>
> Bill wrote:
>> Anyone have some VB code suitable for
>> use with Word 2003 that can used to
>> batch convert a folders worth of wps
>> files to Word documents?
>>
>> Thanks,
>> Bill
>
>
Back to top
Login to vote
Graham Mayor

External


Since: Jul 04, 2006
Posts: 8385



(Msg. 7) Posted: Mon Jul 13, 2009 6:05 am
Post subject: Re: Need VB code to batch convert wps [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

You are welcome to donate a portion of your fee from the client to my
website Wink

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

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


Bill wrote:
> Code worked great. Turned out that my
> client had W2002 installed and inserting
> your code in a general module and running
> from Debug easily converted all 218 wps
> files to doc files of the same name.
>
> Many thanks.
> Bill
>
> "Graham Mayor" <gmayor.TakeThisOut@REMOVETHISmvps.org> wrote in message
> news:eU6$q2SAKHA.3556@TK2MSFTNGP04.phx.gbl...
>>
>> For Word 2007, there's an add-in that you can download from my web
>> site. For Word 2003, the following should do the trick PROVIDED you
>> have the the appropriate Works converter installed. You can download
>> missing Works converters from my web site
>>
>> Sub SaveAllAsDoc()
>> 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", , "Save all"
>> 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
>> strFileName = Dir$(strPath & "*.wps")
>> While Len(strFileName) <> 0
>> Set oDoc = Documents.Open(strPath & strFileName)
>> strDocName = ActiveDocument.FullName
>> intPos = InStrRev(strDocName, ".")
>> strDocName = Left(strDocName, intPos - 1)
>> strDocName = strDocName & ".doc"
>> oDoc.SaveAs FileName:=strDocName, _
>> FileFormat:=0
>> oDoc.Close SaveChanges:=wdDoNotSaveChanges
>> strFileName = Dir$()
>> Wend
>> End Sub
>>
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>>
>> Bill wrote:
>>> Anyone have some VB code suitable for
>>> use with Word 2003 that can used to
>>> batch convert a folders worth of wps
>>> files to Word documents?
>>>
>>> Thanks,
>>> Bill
Back to top
Login to vote
abc

External


Since: Jul 13, 2009
Posts: 1



(Msg. 8) Posted: Mon Jul 13, 2009 7:05 am
Post subject: Re:Need VB code to batch convert wps [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

yes

url:http://ureader.com/msg/1002570.aspx
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> Conversions All times are: Eastern Time (US & Canada) (change)
Goto page 1, 2
Page 1 of 2

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET |
  • IT Support