?
Solved

Import IE favorites into Visual Basic 6 Program

Posted on 2005-03-23
13
Medium Priority
?
262 Views
Last Modified: 2013-11-25
Hi all,
I would like to know how I can open and recursively read the Internet Explorer favorites menu.  I would also like to know how to read the URL linked to each bookmark.  The last thing I would like to do is be able to open up the "Add To Favorites..." dialog from within my VB program.  After opening the Add to Favorites dialog, I need to be able to retrieve the information that the user added.

I realize I will need to use some API, but which ones, and how to implement.  

Thanks!!!!!
0
Comment
Question by:donkey_kong_jr2003
[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
  • 8
  • 5
13 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 13619085
0
 
LVL 28

Accepted Solution

by:
AzraSound earned 1200 total points
ID: 13619182
0
 

Author Comment

by:donkey_kong_jr2003
ID: 13643262
Hi,
I am having trouble getting this code to work.  Stepping through the code, I found that the calls to:

hFile = FindFirstFile(sPath, WFD) and  Loop While FindNextFile(hFile, WFD)

Seem to be returning random values, especially the call to FindNextFile(hFile, WFD).  The big problem is that the loop only runs about 2 or 3 times and each time through WFD.cFileName contains about 15 files names, not just 1.  This causes the loop to end early.  Like I said before, each time I run the code, it will begin with a random file name.

Thanks
0
Industry Leaders: 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!

 
LVL 28

Expert Comment

by:AzraSound
ID: 13643711
What does the code do when you run it?  Does it not list your favorites in the listview?  What do you mean by random values?
0
 

Author Comment

by:donkey_kong_jr2003
ID: 13656517
I did manage to get this to work.  (I was not using a listview, I created my own menu).  I was wondering if there was an simpler way to display the "Add To Favorites..." dialog.  I have seen this done in C++ with a few lines of code.  I seen some sample in VB that looked simple but never could compile them.
thanks
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 13656746
Never seen it done any other way than this in VB.
0
 

Author Comment

by:donkey_kong_jr2003
ID: 13682359
I found a much simpler way to open the Add Favorites dialog.  All you need to do is use:

Dim Shell
Set Shell = CreateObject("Shell.UIHelper")

This then gives you access to the AddFavorite method.  All this in a couple lines of code!
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 13682591
Yes but I don't believe that method gives you the ability to get any info back about the operation, which was part of your initial request:

"After opening the Add to Favorites dialog, I need to be able to retrieve the information that the user added"
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 13682602
BTW, though a few lines of code may look more appealing and be easier to work with, that is the only advantage.  This is not a speedier operation because, #1, there is the over head of creating the ShellUIHelper object, and #2, the object is more than likely doing the exact operation as outlined in my links (via Windows API) under the covers.
0
 

Author Comment

by:donkey_kong_jr2003
ID: 13682679
You are right, but I think this way works better in my situation.  Every time the user open the Favorites popup menu I am dynamically generating the contents before it is displayed.  So after the user adds the link, they will see in in the list the next time that they display the menu.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 13682812
You dynamically add them using the code I posted before as well.  Like I said, its really just a wrapper around the code at the above link.  But, whichever method works for you...
0
 

Author Comment

by:donkey_kong_jr2003
ID: 13683056
Thanks for the help:)
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 13683093
No problem...glad you found what you were looking for.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

764 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