D
Desastor
I developed a template used for client invoices. Upon opening th
template, I am prompted to input various demographics via popup windows
which are then used to be distributed to select areas within th
document via bookmarks. After entering those demographics I can the
proceed to add other relevant information. After I am finished with al
this I save the file into a document format and throw it onto a drive.
All this works fine.
The current problem occurs when I re-open the document for review o
edit at a later point in time. The popup windows I used to complete th
data entry initially show up again and again demand data to be entered.
I am wondering if there is an easy way to basically stop that routin
from running as it has no use at that time anymore.
Thanks in advance for any help offered.
Here is an example of one of the routines:
Sub RequestInfo()
'declare your variable
Dim strID As String
'set variable equal to whatever user types into input box
strID = InputBox("Enter Client's ID#:")
'declare a range
Dim bkID As Range
'set the range equal to your current bookmark
Set bkID = ActiveDocument.Bookmarks("bkID").Range
'pass in the info now contained in the variable (what the use
typed)
bkID.Text = strID
'wrap the same bookmark around this text
ActiveDocument.Bookmarks.Add "bkID", bkID
'select all text
Selection.WholeStory
'update fields
Selection.Fields.Update
'move cursor to deselect
Selection.MoveUp Unit:=wdLine, Count:=1
End Su
template, I am prompted to input various demographics via popup windows
which are then used to be distributed to select areas within th
document via bookmarks. After entering those demographics I can the
proceed to add other relevant information. After I am finished with al
this I save the file into a document format and throw it onto a drive.
All this works fine.
The current problem occurs when I re-open the document for review o
edit at a later point in time. The popup windows I used to complete th
data entry initially show up again and again demand data to be entered.
I am wondering if there is an easy way to basically stop that routin
from running as it has no use at that time anymore.
Thanks in advance for any help offered.
Here is an example of one of the routines:
Sub RequestInfo()
'declare your variable
Dim strID As String
'set variable equal to whatever user types into input box
strID = InputBox("Enter Client's ID#:")
'declare a range
Dim bkID As Range
'set the range equal to your current bookmark
Set bkID = ActiveDocument.Bookmarks("bkID").Range
'pass in the info now contained in the variable (what the use
typed)
bkID.Text = strID
'wrap the same bookmark around this text
ActiveDocument.Bookmarks.Add "bkID", bkID
'select all text
Selection.WholeStory
'update fields
Selection.Fields.Update
'move cursor to deselect
Selection.MoveUp Unit:=wdLine, Count:=1
End Su