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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

896 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

11 Experts available now in Live!

Get 1:1 Help Now