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
236 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
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…

749 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