![]() |
|
#1
|
|||
|
|||
|
Hi All, We have around 10000 word 2003 documents (saved as xml) into sql server database as binary object field. We used interopt facility to mailmerge the data into the document using c# code. Now after upgrading the OS from XP to WIN7 64bit and upgradeing office 2003 to office 2010 (32bit), the interopt does not work as expected on the aspx pages. MS recommended to use openxml sdk with the c# code. But I need to convert all my word 2003 document into word 2010 docx as quickly as possible as openxml sdk does not recognize the word 2003 xml documents. It can recognize only word 2010 docx files not any xml docs. We need some direction on this issue. can someone help? regards ramki |
|
#2
|
||||
|
||||
|
You can convert a whole folder of documents with a simple macro:
Code:
Sub ConvertFiles()
Application.ScreenUpdating = False
Dim strFolder As String, strFile As String, wdDoc As Document
strFolder = GetFolder
If strFolder = "" Then Exit Sub
strFile = Dir(strFolder & "\*.doc", vbNormal)
While strFile <> ""
If InStrRev(strFile, ".docx") = 0 Then
Set wdDoc = Documents.Open(FileName:=strFolder & "\" & strFile, _
AddToRecentFiles:=False, Visible:=False)
wdDoc.SaveAs2 FileName:=strFolder & "\" & Left(strFile, InStrRev(strFile, ".doc")) & "docx", _
Fileformat:=wdFormatXMLDocument, AddToRecentFiles:=False
wdDoc.Close SaveChanges:=False
End If
strFile = Dir()
Wend
Set wdDoc = Nothing
Application.ScreenUpdating = True
End Sub
Function GetFolder() As String
Dim oFolder As Object
GetFolder = ""
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path
Set oFolder = Nothing
End Function
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
MS Word 2010 Content Controls and PDF Conversion.
|
MaxInCO | Word | 3 | 02-13-2014 12:58 PM |
Word 2003 Macro problem running in Word 2010
|
norwood | Word VBA | 2 | 02-03-2014 06:49 PM |
Graphics Created in Word 2003 Cannot Be Displayed in Word 2010
|
mwildem | Drawing and Graphics | 3 | 02-14-2013 10:59 AM |
| Are user customizations transferable from Word 2003 to Word 2010 (2013)? | New Daddy | Word | 3 | 01-14-2013 07:25 AM |
| trying to open a word 2010 document and opens the file conversion window | starfish | Word | 2 | 05-24-2012 12:06 AM |