Results 1 to 2 of 2
Thread: Variables/Bookmarks (Word 97/VB)
2002-05-10, 15:35 #1
- Join Date
- Jan 2001
- Upstate NY, New York, USA
- Thanked 0 Times in 0 Posts
Variables/Bookmarks (Word 97/VB)
This is by far the most bizarre situation I have encountered yet and am hoping someone can shed some light on why this may be occurring.
I have written a document assembly program for a deed package. The first paragraph of the deed may contain one or two sellers. If two sellers, it is instructed to go to a bookmark and insert Seller2 information. There is a "keep space" between Seller1 street, and Seller1 City.
Now here's the odd part. On my PC, when I test the template, it works fine. When I test it at my user stations, it puts the Seller1 City AFTER Seller2 City. When I delete the "keep space" on the user stations, the template works fine. However, if I delete the "keep space" on the template on my hard drive, I get the above aberrant behavior. Very convoluted....
Here's the relevant portion of code:
ActiveDocument.Variables.Add Name:="DocumentDate", Value:=Format(VBA.Date, "MMMM, yyyy")
ActiveDocument.Variables.Add Name:="Seller", Value:=frmDeed.TextBox1.Text
ActiveDocument.Variables.Add Name:="SellerStreet", Value:=frmDeed.TextBox2.Text
ActiveDocument.Variables.Add Name:="SellerCity", Value:=frmDeed.TextBox3.Text
'if more than one seller, show second block of information
'add variations for single/multiple sellers
If frmDeed.CheckBox1.Value = True Then
Selection.GoTo what:=wdGoToBookmark, Name:="Seller2Name"
Selection.TypeText " and "
.Name = "Times New Roman Bold"
.Bold = True
.SmallCaps = True
.Name = "Times New Roman"
.Bold = False
.SmallCaps = False
Selection.TypeText ", " & "residing at " & frmDeed.TextBox5.Text & ", " & frmDeed.TextBox6.Text
I am also attaching a copy of the offending paragraph.
I've searched the registry for some setting that may be different, but am unable to see how one little "keep space" can wreak so much havoc.
As always, your expert advice is very much appreciated. <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>
2002-05-10, 22:52 #2
- Join Date
- Feb 2001
- Silicon Valley, USA
- Thanked 94 Times in 90 Posts
Re: Variables/Bookmarks (Word 97/VB)
Are you saying that the very last TypeText is inserted in the wrong place in its entirety, or that some portion of it is inserted in the wrong place. Neither makes sense, actually. For ease of illustration, I have attached a "code view" of your document.
I think it might be time to export all your code and form modules, remove them from the project, and re-import them. Corruption happens, and when things stop making sense, you need to try to rule that out.