Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I use VBA to translate an rtf to txt

Status
Not open for further replies.

KOVMoe

Programmer
Jun 30, 2004
34
US
I am using VBA to ftp a file in s stored procedure in SQL. I can download the file, but cannot do anything with the file due to the format of RTF. I need txt to move the information to a table. Has ayone done this, or seen this done?

Thank you,

[king]Moe-King of the Village Idiots.

"When in trouble,
when in doubt;
Run in circles-
SCREAM & SHOUT!!"
Burma Shave
 
First, how is it that you get it in RTF format and not text? The easiest thing by far is to get a text file.

Moving on, try opening the RTF in Word and saving it as a text file. If you can successfully read the text file in Access, use Automation to get Word to do the steps you need. The below automates Access.

Sub Example
Dim App As Application
Set App = CreateObject("Access.application")
App.Visible = True

App.OpenCurrentDatabase strDBpath, False
App.DoCmd.OpenForm strFrmName, acNormal, , strfilter

Set App = Nothing
End sub


You could use
Set App = CreateObject("Word.application")
to automate word. I hope this gets you thinking in the right direction.

Also don't forget the usefulness of the record macro feature in Word.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top