Results 1 to 3 of 3

Thread: VBA to Word

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    179

    VBA to Word

    Hii all,

    I have made an application to send the values from VB to Word.
    Using bookmarks in word and created a template. Now that template has 25 bookmarks, named as B1, B1E, B2, B2E, B3, 3E, B4, B4E..........B25, B25E.
    Now when i save the data into the template i get an Error, when the value of i=11 i get the error message
    the code goes as follows:----------------------------------------------

    VB Code:
    1. Public FldRng(1 To 25) As Range
    2.  
    3. Public Sub SavePage1()
    4. Dim i As Integer
    5.     For i = 1 To 25
    6.     FldRng(i) = Page1.Text(i)
    7.     Next
    8. Pages.Save
    9. FormChanged = False
    10. End Sub
    11.  
    12. Public Sub SetRanges1()
    13. Dim i As Integer
    14. For i = 1 To 25
    15. [COLOR=YellowGreen]' at this place i get an error[/COLOR]
    16. Set FldRng(i) = Pages.Range(Start:=Pages.Bookmarks(i * 2 - 1).Range.End, _
    17.       End:=Pages.Bookmarks(i * 2).Range.Start - 1)
    18. Next
    19. End Sub
    --------------------------------------------------------------------------

    the above are small Functions that use.
    can someone pls help me.
    thanks
    Last edited by RobDog888; Oct 8th, 2005 at 08:51 PM. Reason: Added [vbcode] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width