L
Lee
I want to write some code that will check to see if a
bookmark exists and if it does, run a userform. Once the
user has filled in the userform and clicked OK, I want the
code to find the bookmark and delete it.
If the bookmark doesn't exist, then I don't want the code
to run...
I have the following code:
Sub Autonew()
If ActiveDocument.Bookmarks.Exists("new") = True Then
FrmOutwardLetter.Show
End If
End Sub
and within the userform code I have the following code to
delete the bookmark:
ActiveDocument.Bookmarks("new").Select
Selection.Delete
BUT nothing seems to be working! The userform doesn't
show anymore - What am I doing wrong? (It's probably all
wrong!).
I was trying to create a custom boolean property, set its
value to false and change it to true once the userform
runs. Then always check for the value of the said
property when document is opened, and if it is true, do
not run the code. Wasn't sure how to do this as this is
all new to me... (
Thanks in advance
Lee
bookmark exists and if it does, run a userform. Once the
user has filled in the userform and clicked OK, I want the
code to find the bookmark and delete it.
If the bookmark doesn't exist, then I don't want the code
to run...
I have the following code:
Sub Autonew()
If ActiveDocument.Bookmarks.Exists("new") = True Then
FrmOutwardLetter.Show
End If
End Sub
and within the userform code I have the following code to
delete the bookmark:
ActiveDocument.Bookmarks("new").Select
Selection.Delete
BUT nothing seems to be working! The userform doesn't
show anymore - What am I doing wrong? (It's probably all
wrong!).
I was trying to create a custom boolean property, set its
value to false and change it to true once the userform
runs. Then always check for the value of the said
property when document is opened, and if it is true, do
not run the code. Wasn't sure how to do this as this is
all new to me... (
Thanks in advance
Lee