|
Visual Basic (VB 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! |
Please read the DISCLAIMER.
Here is an INDEX to all the procedures.
You will probably need one copy of my GLOBAL DECLARATIONS.
Public Function boolBookmarkExists(strFile As String, strBkMark As String) As Boolean
' Procedure : boolBookmarkExists
' Description: test for existence of a bookmark
' Copyright: Chris Greaves Inc.
' Inputs: A document name, a bookmark name..
' Returns: TRUE if the supplied bookmark is in the existing document.
' Assumes: None.
' Side Effects: None.
' Tested: By the calls shown below.
boolBookmarkExists = False
If boolFileExists(strFile) Then
Dim strDoc As String
strDoc = strGetFilename(strFile, intcFullName)
If boolOpenFile(strFile) Then
Dim lngBookmarks As Long
lngBookmarks = Documents(strFile).Bookmarks.Count
Dim lngInd As Long
For lngInd = 1 To lngBookmarks
If strBkMark = Documents(strFile).Bookmarks(lngInd) Then
boolBookmarkExists = True
Exit For
End If
Next lngInd
Else
End If
Else
End If
'Private Sub TESTboolBookmarkExists()
' MsgBox boolBookmarkExists(strTemplatePath & "emsreference.doc", "BrokerWareAddressesEmail")
' MsgBox boolBookmarkExists(strTemplatePath & "emsreference.doc", "BrokerWareAddressesWebSites")
' MsgBox boolBookmarkExists("z:\greaves\clients\ems\emsreference.doc", "BrokerWareAddressesWebSites")
'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 Thursday, November 15, 2001 |