Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Plain .TXT file to Word .DOC file via Excel VBA - Possible?

Well, the subject says it all :-)

Plain .TXT file to Word .DOC file via Excel VBA - Possible?

If it's possible, could someone help me with the code?


TIA,

CE


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Plain .TXT file to Word .DOC file via Excel VBA - Possible?

This code will work. I'm using word to do the conversion, but running the
macro in Excel. Does that meet the requirements?

FName = "c:\temp\abc.txt"
WordFName = "c:\temp\abc.doc"

Set Wordobj = CreateObject("Word.Application")
Wordobj.Visible = True

Wordobj.Documents.Open Filename:=FName, _
ConfirmConversions:=False
Wordobj.activedocument.SaveAs Filename:=WordFName, _
FileFormat:=wdFormatDocument

Wordobj.Quit

"Charlotte E." wrote:

Well, the subject says it all :-)

Plain .TXT file to Word .DOC file via Excel VBA - Possible?

If it's possible, could someone help me with the code?


TIA,

CE



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Plain .TXT file to Word .DOC file via Excel VBA - Possible?

Thanks, Joel :-)

With a little modifications I got it to work, just as I wanted :-)

CE


Joel wrote:
This code will work. I'm using word to do the conversion, but
running the macro in Excel. Does that meet the requirements?

FName = "c:\temp\abc.txt"
WordFName = "c:\temp\abc.doc"

Set Wordobj = CreateObject("Word.Application")
Wordobj.Visible = True

Wordobj.Documents.Open Filename:=FName, _
ConfirmConversions:=False
Wordobj.activedocument.SaveAs Filename:=WordFName, _
FileFormat:=wdFormatDocument

Wordobj.Quit

"Charlotte E." wrote:

Well, the subject says it all :-)

Plain .TXT file to Word .DOC file via Excel VBA - Possible?

If it's possible, could someone help me with the code?


TIA,

CE



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convert email address file in Excel 2000 to Word file with commas Mike A. Excel Discussion (Misc queries) 8 October 14th 08 02:48 PM
Import word file into excel as plain text Nick Excel Discussion (Misc queries) 1 June 23rd 08 04:22 PM
Formatted word file from an excel file??? Cap Excel Programming 0 November 15th 07 11:54 AM
How to make a routine that will automatically print a word file after it has been changed via an ole link to an excel file? Starriol Excel Programming 0 November 3rd 05 11:59 AM
send contents of cell b4 to a plain text file lothario[_68_] Excel Programming 5 January 22nd 04 09:37 AM


All times are GMT +1. The time now is 08:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"