Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2007

Tip: Looking for answers? Try searching our database.

Reason for not including images in .rtf

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TriXteR - 22 Jun 2007 11:56 GMT
I am trying to display some HTML body in a richtextbox. Therefor I convert
the *.html file to *.rtf using the wordobject

------------------------------------------------------------------------------
'body html is a plain html file
'savertf is the path & file to save to

   Dim savertf As String = sLocalpath & lbl_ourref.Text & ".rtf"
               Dim objWord As New Word.Application
               With objWord
                   .DisplayAlerts = Word.WdAlertLevel.wdAlertsNone
                   .Documents.Open(Bodyhtml)                'savehtm)
                   .ActiveDocument.SaveAs(savertf, 6)
                   .ActiveDocument.Close()
                   .Quit()
               end with
---------------------------------------------------------------------------------

I've noticed that when using Word(2003) to save .html as .rtf-file Word
sometimes includes the images in the .rtf-file, but other times it does not.
I've tested this with 'www.google.com' (images are included) and
'www.forkyou.nl' (images are not included)
The actions taken are identical in Word('Open File'--'Save File As (RTF)'

Does anyone know the reason why this difference occurs, or a way to always
include the images in the RTF??
TriXteR - 25 Jun 2007 08:44 GMT
I really would appreciate if anyone could help me with this, even if you
don't have the sollution could someone please confirm that this is in fact
true without any good reason for it?

Many thanks.

> I am trying to display some HTML body in a richtextbox. Therefor I convert
> the *.html file to *.rtf using the wordobject
[quoted text clipped - 22 lines]
> Does anyone know the reason why this difference occurs, or a way to always
> include the images in the RTF??
TriXteR - 25 Jun 2007 11:05 GMT
ok. I disected the HTML behind the google-page and found something completely
illogical....again.

The line that makes sure the images are included in the RTF is:
<INPUT type=hidden value=nl name=hl>

from the below code, without this line Word will not include the
image........why does this line effect the includeing of images in RTF? It
really seems to have nothing to do with the 'logo.gif' IMG...?!?!?!?!

<HTML><BODY><BR id=lgpd>
<IMG height=110 alt=Google src="logo.gif" width=285>
<TABLE cellSpacing=0 cellPadding=0>
<TBODY>
<TR vAlign=top>
<TD noWrap align=middle>
<INPUT type=hidden value=nl name=hl>
</TD></TR></TBODY></TABLE></BODY></HTML>

> I really would appreciate if anyone could help me with this, even if you
> don't have the sollution could someone please confirm that this is in fact
[quoted text clipped - 28 lines]
> > Does anyone know the reason why this difference occurs, or a way to always
> > include the images in the RTF??
TriXteR - 29 Jun 2007 10:26 GMT
nice to see the overwelming responces.....

I've given it up, quit my job and am now a prostitute....

> ok. I disected the HTML behind the google-page and found something completely
> illogical....again.
[quoted text clipped - 47 lines]
> > > Does anyone know the reason why this difference occurs, or a way to always
> > > include the images in the RTF??

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.