Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / August 2006

Tip: Looking for answers? Try searching our database.

Image problem in converting HTML to MS Word doc

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
s.danyal.k@gmail.com - 24 Aug 2006 13:52 GMT
Hi All,
I have created an application in C# that converts HTML file to MS word
documents. The HTML file may also have images , for e.g "<img
src='http://www.google.com.pk/images/hp0.gif'></img>".
The HTML file saved into .doc file. Now the problem is
that whenever the .doc file is opened it goes to the link mentioned in
the <img> tag. This means that only the link is saved in the .doc file
and not the ACTUAL image. Now I want the actual image to be saved in
the .doc file and not the link to that image. Any idea on this problem
will be appreciated.

Danyal
Peter Bromberg [C# MVP] - 24 Aug 2006 14:14 GMT
I don't know what you are doing to "convert" your HTML into a word document
file, but in this case your code would need to :

1) Download each image from its url in the HTML document.
2) Convert the image to its Word Doc counterpart using the Word object
model, or
3) Convert the image to its proper MIME -encoding (normally Base64) and
insert the proper MIME boundary headers.

Hope that helps.
Peter

Signature

Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

> Hi All,
> I have created an application in C# that converts HTML file to MS word
[quoted text clipped - 8 lines]
>
> Danyal
Peter Jamieson - 24 Aug 2006 14:36 GMT
Something along the following lines may be enough - there are other ways to
insert images that are not inline.

Dim strImagePath as String
strImagePath = "http://www.google.com.pk/images/hp0.gif"
rngSomeRange.InlineShapes.AddPicture _
 FileName:=strImagePath, _
 LinkToFile:=False, _
 SaveWithDocument:=True

> Hi All,
> I have created an application in C# that converts HTML file to MS word
[quoted text clipped - 8 lines]
>
> Danyal

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
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.