Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to place an URL into a VFP-table easily 4

Status
Not open for further replies.

kbklaus

Technical User
Mar 30, 2007
9
DE
Hi,
I would like to store a lot of Internet-Urls into a VFP-table
whenever I find a good one.
The best way would be to drag and drop them as long as they are required by dragging them from the Internet-screen (IE o Firefox) into the VFP-table.

My question(s):
---------------
1.Is that possible in a such a way (similiar as e.g.someone puts his bookmarks in Firefox into the bookmark-folders) - or did you know a piece of coding for that?

2.If this is not possible, how to read the bookmark-folder
of Firefox or IE into .dbf-format?

3.How would you solve this with only a few mouse-events?


 
Not knowing the environment you'll be working in, it is rather hard to answer.

ASSUMPTIONS
You will have Foxpro up and running, Table open in one window
in another window you will have the browser running

I'd go to VFP, and write 2 macros to save the keystrokes
One to Cut the URL from the browser
{HOME}{CTRL+A}{CRTL+X}{CTRL+V}
the other to Select Table , Append Record, and Paste the Info into a field
(Macro to long to type in so just do the keystrokes with VFP macro redorder on.)
I would then save the macros to a file. *.FKY is a VFP Macro file

When you start VFP you run the program to populate the Macro to the keyboard.

when in the browser Press the Key(s) for MAcro #1
Select VFP
Press the Key(s) for MAcro#2

I Know there is an API call to switchs windows to VFP (check the FAQ section) so you can add that in also.
Then you can combine MAcro#1, API Call and MAcro#2 into one.

David W. Grewe (Dave)
 
David - you assumptions were correct.
And your idea of using macros is a very good one.
As the url is always on the same place to catch this should be
much more easier than to do all these CTRL's manually.

I will look also for API calls.
I look forward to other suggestions of course.
Thanks.
Klaus.

 
Klaus,

You could do it with drag-and-drop.

Both IE and Firefox let you drag a URL out of the address bar. And VFP lets you drop the URL into a text box. If you're not sure how to do that, read the Help topic, "OLE Drag and Drop", or look at the sample OLEDD form.

You also asked about reading bookmarks progammatically. In IE, each bookmark is stored as a file in the Favorites folder, under Documents and Settings\<user name> (that's in XP; might be different in other versions of Windows). So you can read the bookmarks by using ADIR() and looping through the resulting array.

In Firefox, the bookmarks are stored in an HTML file, in your Profile folder which is somewhere in Documents and Settings/Application Data (browse around that area and you'll find it). You could use FILETOSTR() to get the HTML into a VFP variable, then parse out the individual bookmarks.

Hope this helps.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
kbklaus

In addition to what Mike has told you, you will need to error trap what is being dropped onto whatever control.

Text and URLs, also text, are oDataObject.GETFORMAT(1) so you can use code such as
Code:
[COLOR=blue]IF LEFT(UPPER(oDataObject.GETDATA(1)),5) = "HTTP:"[/color]
[tab][COLOR=green]* URL dropped so OK to go[/color][COLOR=blue]
ENDI[/color]

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Manully: thru Clipboard:
1. copy an URL from Address bar in browser (both Firefox and IE: rightclick+context menu) into clipboard
2. RighClick Event on your table field:
REPLACE fieldname WITH _CLIPTEXT

Programmatically: see Mike
 
Thanks to all of you good guys. You helped me very much with your nice ideas. I think that the drag & drop method is the most convenient way for a user because he is familiar with this method.

There is now still a new question left:

How can I organize that both screens (Windows and my Foxpro-Form are automatically placed horizontally or vertically on my screen.

At the moment I have to reduce the size of the windows-screen und my foxpro-screen manually....which is less convenient, as
I have to do this whenever I like to drag and drop the internet-adress from Windows to VFP.

Sorry for my school-english...my mother taught me German.



 
kbklaus

Thanks for the star.

Please ask your new question in the Microsoft: VFP - Forms, Classes and Controls forum as it is off-topic to this thread and to this forum.

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top