AddToFavorites method

Microsoft Visio Developer Reference

AddToFavorites method

       

Adds a shortcut for a hyperlink address in the presently registered Favorites folder.

Version added

5.0

Syntax

object.AddToFavorites [favoritesTitle]

object

Required. An expression that returns a Hyperlink object.

favoritesTitle

Optional String. The title to assign to the new shortcut.

Remarks

If a string is not supplied, the AddToFavorites method uses the hyperlink's Description property as the new favorite's title. If the Description property is empty, the shortcut is given a generic title, such as Favorite1.

The optional favoritesTitle argument can specify the full path for the favorites file, for example, "C:\TEMP\My Favorite.URL", or a path relative to the favorites folder.

From Microsoft Visual Basic or Visual Basic for Applications, a call to the AddToFavorites method can take either of these two forms:

object.AddToFavorites "SomeString" 
object.AddToFavorites

From C/C++, if a string is supplied, pass a Variant of type VT_BSTR. The application assigns the string as the title of the shortcut. If a string is not supplied, pass a Variant of type VT_EMPTY, or of type VT_ERROR and HRESULT DISP_E_PARAMNOTFOUND.