Author Topic: OLE and Word 2010  (Read 3152 times)

troya2od

  • Newbie
  • *
  • Posts: 1
OLE and Word 2010
« on: July 02, 2013, 07:34:55 am »
I have a few thousand files that I need to convert from .doc to .docx and to .txt.

When using objDoc.SaveAs(ProcessedFile) with the file extension  .txt the file is saved with the .txt extension but is still in the .doc format. The .docx output extension throws a 1261: Ole: Exception.

Obviously I am missing a file format parameter. Can someone point me to the file format values and usage syntax?

TIA
Troy

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: OLE and Word 2010
« Reply #1 on: July 02, 2013, 07:56:31 am »
The Word SaveAs method has a number of optional parameters. One being the FileFormat parameter: http://msdn.microsoft.com/en-us/library/office/bb221597(v=office.12).aspx, the value specific should be one of the wdSaveFormat constants, defined here: http://msdn.microsoft.com/en-us/library/office/bb238158(v=office.12).aspx. In your case the value2 for wdFormatText (Microsoft Windows text format).

Reference: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/OLE~with~Word+Word~SaveAs~HTML.txt
Deana F.
Technical Support
Wilson WindowWare Inc.