Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1219
  • Last Modified:

RichTextBox loading Word created RTF files

As the title implies, what are some considerations here?  For example, I created a template in Word to use for generating a report.  I saved it as an *.rtf file.  The template contains a header/footer and a graphic.  When I load it into the VB richtextbox control, nothing appears.  Why is that?  If this isnt a possible solution, what are my alternatives?  Thanks in advance.
0
vblogic
Asked:
vblogic
  • 8
  • 7
  • 2
1 Solution
 
Dave_GreeneCommented:
Load it like so...

RTB.LoadFile file.rtf, rtfRTF
0
 
vblogicAuthor Commented:
I have done that.  If I then view the TextRTF property of the control, its showing the correct RTF codes (the same as if I opened the RTF file in a plain text editor).  However, the control does not show either the image, or the header/footer, as can be seen from viewing the same RTF file in Word.
0
 
Dave_GreeneCommented:
Not sure if this is a limitation of the VB control or not...  
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
Dave_GreeneCommented:
Must be a limitation.

Just place the image outside the header region in word and it will display.
0
 
Dave_GreeneCommented:
You will just need to minimize the header and footer region and place the items in at the top and bottom manually.

Cheers
0
 
wmikeCommented:
I'm not sure what your options are,
but you're using 2 different file types here.
A rich text box supports rtf files and a
word template (dot file) is not an rtf file.
0
 
vblogicAuthor Commented:
I saved the Word template file (*.dot) as an rtf file, and it is THAT rtf file which does not show in the VB richtextbox.
0
 
vblogicAuthor Commented:
I ended up having to build specific rtf codes manually to create the effects I needed.  The VB richtextbox needs to get its butt in gear IMHO.
0
 
Dave_GreeneCommented:
True, True

:)
0
 
wmikeCommented:
I tried doing what you said using Word97,
but after creating the *.dot file,
Word disabled the File Type box so
I couldn't resave the *.dot as a *.rtf.

I could save the original *.doc as an
*.rtf and I loaded that into the RichTextBox.
The graphic appeared but the header didn't.
I opened WordPad and I didn't see anywhere
that it could handle Headers.
Does that help?
0
 
vblogicAuthor Commented:
well, in Word2000 i was able to save the *.dot as a *.rtf file.  however, the headers, and logo included in the header, did not show on the richtextbox control.  i ended up doing it manually via code, and manually entering specific rtf codes to adjust margins and other things that were originally stored in the template file (all of which did not show up in the richtextbox control).

thanks for your time guys, but i ended up having to just do this one myself.
0
 
Dave_GreeneCommented:
Just as I posted earlier

Comment
From: Dave_Greene  Date: 07/18/2001 08:13AM PST  
You will just need to minimize the header and footer region and place the items in at the top and bottom
manually.

Cheers  
0
 
vblogicAuthor Commented:
Just as you posted earlier

Comment
From: Dave_Greene  Date: 07/18/2001 08:02AM PST  
Not sure if this is a limitation of the VB control or not...


which was my original question.  Apparently, you didnt know either, and you went and loaded a sample to see the same thing I saw.  The obvious thing to consider after finding out the VB richtextbox is lame is to DIY.  Your last comment seems to imply that you knew something I didnt know.  If you want my points that bad, I'll give them to you, but please dont pretend to have offered anything of any real value here.
0
 
Dave_GreeneCommented:
No, I could care less about the points...  The issue is that I told you it couldn't be done that way before you found out for yourself.  So essentially I did answer your question.  The unfortunate outcome however was that it couldn't be done with VB's RTB.

Suppose I posted the answer, and you found the answer yourself sometime later, would the same situation apply?  
0
 
vblogicAuthor Commented:
>>The issue is that I told you it couldn't be done that way before you found out for yourself.  

This is a complete contradiction of what happened here.  From the beginning, you assumed it would work, and then explained that you werent sure.  You told me what I already knew.  In essence, I knew it before you did...that the VB richtextbox did not support headers/footers.  How did I found out?  I loaded an rtf file with headers into the VB richtextbox and nothing showed up.   How did you find out?  You loaded an rtf file with headers into the VB richtextbox and nothing showed up.  I hardly think that constitutes finding the answer before I did.  

I already knew, and I think most people do, that you can add pictures to the VB richtextbox.  Telling me to do that was nothing extraordinary, it was just a last resort if there was no better alternative.  I thought perhaps Word supported headers with certain rtf codes not supported by the VB richtextbox, but that the VB richtextbox did support other rtf codes that would give a similar effect...like one of the rtf codes listing in the MSDN library.

At any rate, I do thank you for your time.  I dont mean to argue, just please dont try to act as if you have exhibited some great profound knowledge here, and that I should in some way be in awe of it.  I dont believe the "experts" at this site exist on any level higher than I.  Just because I choose not to spend time answering questions here does not make me any less capable.
0
 
Dave_GreeneCommented:
VB,

I tried many things behind the scenes and came up with the outcome which I shared with you.  Yes, it wasn't brain surgery, but it did at very least let you know that it wasn't something you were doing wrong.  Which can be as valuable as source code out of thin air.  You're welcome for my time spent on this thread, and no I do not think I am better than you in any way.  Just trying to help, that is all.

-Dave
0
 
vblogicAuthor Commented:
Thanks Dave...been one of those days for me.  I apologize for coming off so hostile.  See ya on the boards...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 8
  • 7
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now