• Variables/Bookmarks (Word 97/VB)

    Author
    Topic
    #370752

    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 ”
    With Selection.Font
    .Name = “Times New Roman Bold”
    .Bold = True
    .SmallCaps = True
    End With
    Selection.TypeText frmDeed.TextBox4.Text
    With Selection.Font
    .Name = “Times New Roman”
    .Bold = False
    .SmallCaps = False
    End With
    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. brickwall

    Viewing 0 reply threads
    Author
    Replies
    • #587443

      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.

    Viewing 0 reply threads
    Reply To: Variables/Bookmarks (Word 97/VB)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: