XML Source RTF file in Excel to Text

ddobrzynski

New Member
Joined
Jun 17, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I am designing an Excel Report that will generate a scope of work for that project. Currently using XML Sources to bring in the data to Excel but the Scope of work is an RTF file only generates the file name. I am trying to code a macro that will take an XML Source that is an RTF file and display it as text in the cell. Is this even possible?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi. I'm not sure I fully understand what you're asking for. Do you mean you're trying to get the XML code contained with an RTF file?
 
Upvote 0
Hi. I'm not sure I fully understand what you're asking for. Do you mean you're trying to get the XML code contained with an RTF file?
Thanks for the response!
Yes, I'm creating an Excel report from a Program called SI D-tools. I am trying to pull a Scope of work RTF file from its XML data but when I do all I get is the file name and not the contents.
 
Upvote 0
Hmm, so RTF isn't encoded using XML, it has its own special code (you can see it if you open the rtf file in notepad for example.)
If what you're trying to do is extract the contents from an RTF file, XML is not going to help you. You will need to use a method in VBA; is using vba a possibility for you? If so, I can try and dig out some code for you.
 
Upvote 0
No problem. It may not yet work, but leave it with me, and I'll see what I can try and sort out for you. I probably won't be able yo get back to you until the end of the weekend, if that's ok.
 
Upvote 0
No problem. It may not yet work, but leave it with me, and I'll see what I can try and sort out for you. I probably won't be able yo get back to you until the end of the weekend, if that's ok.
Awesome! No, there is no rush at all. Thank you again i really appreciate it.
 
Upvote 0
Hi. I've started to have a look into this, and I think I may have been overthinking it. I have a couple of questions:
- Do you have a sample of the RTF file (even if anonymised data) that I can check to see what it is that you're trying to extract? Presumably, you just need the text, and not the formatting?
- Can you explain a little more about your project - specifically, what do you do with the contents once it's been extracted?
- Do you have MS Word on the computer? I ask because this could potentially be an easy solution.

Thanks.
 
Upvote 0
It doesn't look like I can upload a file to here. But yes, I just want to take the text from an RTF file and display that in an excel cell. Yes, I have MS Word. I tried a script that would open word and copy the text to the cell but that used a file location which will be different for every report I generate with XML source code.

This is how I am creating the report: D-TOOLS EXCEL REPORTS

In the XML Source code, it looks like it just brings in the name of the file and nothing else " <xs:element name="ScopeOfWorkRtfFile" type="xs:string"/>"

Thank you.
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top