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 BkMkSnagger(tbl As Table) ' Procedure : BkMkSnagger ' Description: Generate a bookmark (from BOLDed text) for the current table. ' Copyright: Chris Greaves Inc. ' Inputs: Called by the user ' Returns: None. ' Assumes: The table is preceded by a short item in BOLDed text. ' Side Effects: None. ' Tested: By the calls shown below. If Selection.Information(wdWithInTable) Then Call rngTableStart ' go to the head of the table Dim rng As Range Set rng = Selection.Range If rng.Start <> rngFindBoldUpward.Start Then ' look for the most immediately preceding bolded text (if any) Dim strMyName As String strMyName = strSnagText If Len(strMyName) > 2 Then Call rngTableNextTable ' there has to be a table, we were in one at the start Call rngTableSelectRow ' there has to be a table, we were in one at the start Call BkMkPasteBookMark(strMyName) Else ' the found text is too short for a name End If Else ' we couldn't find any bolded text End If Else ' we aren't even in a table? What are you THINKING?!!! End If 'Sub TESTBkMkSnagger() 'Call BkMkSnagger(Selection.Tables(1)) '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