Visual Basic (VB6 and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

Visual Basic Library

This page was last updated on Saturday, November 24, 2001

Public Function BkMkPasteBookMark(strMyName As String) ' Procedure : BkMkPasteBookMark ' Description: Apply a bookmark to the current selection. ' By: Chris Greaves Inc. ' Inputs: STRING name of a bookmark ' Returns: None ' Assumes: None. ' Side Effects: The named document contents (specifically the bookmarks) may change. ' Tested: By the calls below. ' A better function could be written in which: ' a RANGE appears as an argument ' a test is made for existence of a bookmark prior to creation ' count of bookmarks is returned ' sorting is changed/not changed ' showHidden is set/unset With ActiveDocument.Bookmarks .Add Range:=Selection.Range, Name:=strMyName .DefaultSorting = wdSortByName .ShowHidden = False End With 'Sub TESTBkMkPasteBookMark() 'Call BkMkPasteBookMark("erasethis") ' now go to the document and choose Insert, Bookmarks, GoTo 'End Sub End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Monday, November 19, 2001

 

 

Hosted by www.Geocities.ws

1