Copying multiple rtf file contents with formatting into a single cell in Excel

LA_Chaudhry

New Member
Joined
Nov 13, 2019
Messages
4
I am busy making an eCommerce website, I have made a csv database with all the information that I need.
The issue I am facing now, I have thousands of rtf files for each items product description that I would like to add into excel.
The contents of each rtf file should be copied into a single cell into excel ie. 1 rtf file contents = 1 cell in excel with formatting.

I have tried pasting the link of the rtf file from the server into excel but the website just displays the link.
Is there any VBA code or macro I could run to solve this issue? Or is there another way I could link my rtf file into WooCommerce to display the contents of the rtf file on my website?


I have tried the following code (The first response by Andrew Poulsom): https://www.mrexcel.com/forum/excel-questions/47227-code-open-rtf-file-word.html

Which works including the formatting but distributes the contents into different cells and works for only 1 file at a time.


I don't want to open,copy and paste every rtf file into excel and have researched for quite a while on how to do this.
Any help will be appreciated ^_^
 

LA_Chaudhry

New Member
Joined
Nov 13, 2019
Messages
4
I can't find where I can edit my post, I missed some critical information.
The name of the rtf file is the, product name.rtf. The product name is in column A of my excel database.

Here is the code that I tried used, posted by Mr Andrew Poulsom in the link above:
<code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; vertical-align: baseline; box-sizing: inherit; white-space: inherit;">Sub Test()
Dim WordApp As Object
Set WordApp = CreateObject("Word.Application")
With WordApp
' Change file name to suit
.Documents.Open Filename:="P:\TEMP\MrExcel\RTFFile.rtf"
.ActiveDocument.Select
.Selection.Copy
End With
ActiveSheet
.Range("A1").Select
ActiveSheet
.Paste
WordApp
.Quit
Set WordApp = Nothing
End Sub</code>
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
41,739
Office Version
365
Platform
Windows
I can't find where I can edit my post, I missed some critical information.
There is only a short period of time when you might be able to edit your post. Otherwise, do what you have done and just make another post explaining the changes you want to make.
 

LA_Chaudhry

New Member
Joined
Nov 13, 2019
Messages
4
Can no one help me?
How would most eCommerce websites go about doing this with thousands of products?
I got the images and the rtf files (for the description of each item) from the supplier.
 

Forum statistics

Threads
1,077,849
Messages
5,336,734
Members
399,100
Latest member
darcob

Some videos you may like

This Week's Hot Topics

Top