+ Reply to Thread
Results 1 to 4 of 4

File format converted from .txt to . docx

  1. #1
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    633

    File format converted from .txt to . docx

    Dear All,
    This is my first post regarding word documents. I want to convert file format from (.txt) to (.docx) with help of macro. Below VBA/macro codes for converting .text file to .docx file. This code is running fine & file converted to .docx as well but the problem is , I can’t open the converted .docx file , it is showing below error

    The file cannot opened because there are problems wih the contents.

    Details:
    The file is corrupt and cannot be opened.


    Please Login or Register  to view this content.
    I need all of your help to solve my issue.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: File format converted from .txt to . docx

    You are exporting as PDF but naming it with .docx. That is the problem.

    If you want a .docx file you have to SaveAs instead of Export.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: File format converted from .txt to . docx

    Untested, but this gives you the idea.
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    633

    Re: File format converted from .txt to . docx

    Hi 6StringJazzer,

    Great ! It works perfectly, I appreciated it, it will help me a lot. Thanks for your valuable time in this regard.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to create docx file
    By RAFA_NADAL in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-21-2018, 06:13 AM
  2. How to read cells values from a converted to excel (converted to exe file)
    By AttalaEA in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2014, 02:57 AM
  3. [SOLVED] .DOCX File - Unable to add text to fields
    By DavoP in forum Word Formatting & General
    Replies: 4
    Last Post: 05-08-2014, 03:38 AM
  4. Include a DOCX file when exporting Excel to PDF
    By andyb63uk in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2013, 08:17 PM
  5. Replies: 0
    Last Post: 08-23-2013, 07:57 AM
  6. Compiling .docx files into a single .xls file
    By Cheshire in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-11-2010, 03:46 PM
  7. How do I update hyperlinks to the converted docx files?
    By J.wills in forum Word Formatting & General
    Replies: 0
    Last Post: 03-07-2009, 04:37 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1