Reply
 
Thread Tools Display Modes
  #1   Report Post  
Desastor Desastor is offline
Junior Member
 
Posts: 0
Default VBA, Modules, Userform and problems

I developed a template used for client invoices. Upon opening the template, I am prompted to input various demographics via popup windows, which are then used to be distributed to select areas within the document via bookmarks. After entering those demographics I can then proceed to add other relevant information. After I am finished with all 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 or edit at a later point in time. The popup windows I used to complete the 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 routine 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 user 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 Sub
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How list people for some modules or for all modules lemon scented Mailmerge 1 May 28th 10 06:09 AM
Compile Error in Hidden Charge back Modules Liela Microsoft Word Help 1 July 10th 08 03:57 PM
CREATEING MODULES TEMPLATE Jama Microsoft Word Help 1 December 4th 07 07:43 PM
To create modules in MSWord SeasTheMoment5 Microsoft Word Help 1 December 9th 04 03:38 AM
To create modules in MSWord Tampa Microsoft Word Help 0 December 9th 04 02:09 AM


All times are GMT +1. The time now is 05:57 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"