Solved

Getting the name of the file which has been <EMBED> in Internet Explorer so it can be opened by an associated ActiveForm?

Posted on 2003-10-21
7
234 Views
Last Modified: 2010-04-05
I have created an ActiveForm in Delphi6 for displaying Tiff Images.  I need the ActiveForm to load a tiff file when it is <Embed> in a Html Page, for example:

<EMBED src=&#8221;[Filename].tiff&#8221; width=100 height=100>

I&#8217;ve got the ActiveForm to load up when you embed a tiff file into the html page, but I cannot access or extract the tiff filename from the < EMBED> tab.
0
Comment
Question by:StayGreedy
  • 2
  • 2
7 Comments
 

Accepted Solution

by:
waldude earned 30 total points
ID: 9597273
Have you tried reading the file into a text field or string, and doing something like: AnsiPos('<EMBED', htmlstring); That would give you the position in the string <EMBED is located, then add some spaces to account for the file name, use the copy function to grab it.

Some more complicated, but more powerfull are regular expressions.

http://www.latiumsoftware.com/en/articles/00009.php
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56reconIntroductionToRegularExpressions.asp

You can use regular expressions to search for parts of text surrounding the text you are after.

Good luck,
Brandon  
0
 
LVL 26

Assisted Solution

by:EddieShipman
EddieShipman earned 30 total points
ID: 9603898
Try this:

var
 ovEmbed: OleVariant;
begin
 ovEmbed := WebBrowser1.OleObject.Document.all.tags('EMBED');
 Memo1.Lines.Add(ovEmbed.src);
end;

0
 
LVL 1

Author Comment

by:StayGreedy
ID: 9613321
I would like to delete this question, so that I can re-phrase it as the answers I am getting do not solve my problem.

Thank you for your answers, but they don't solve my problem.  However, they are good answer, that I will most likely find use for in future projects.  And for your effort I would like to reward you both 30 Points.  

Cheers.

Russell

0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 9613688
no problem here...
0
 

Expert Comment

by:waldude
ID: 9614213
Sounds fine to me.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question