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
232 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now