|
-
Oct 8th, 2005, 07:03 PM
#1
Thread Starter
Addicted Member
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:
Public FldRng(1 To 25) As Range
Public Sub SavePage1()
Dim i As Integer
For i = 1 To 25
FldRng(i) = Page1.Text(i)
Next
Pages.Save
FormChanged = False
End Sub
Public Sub SetRanges1()
Dim i As Integer
For i = 1 To 25
[COLOR=YellowGreen]' at this place i get an error[/COLOR]
Set FldRng(i) = Pages.Range(Start:=Pages.Bookmarks(i * 2 - 1).Range.End, _
End:=Pages.Bookmarks(i * 2).Range.Start - 1)
Next
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
-
Oct 8th, 2005, 07:58 PM
#2
Frenzied Member
-
Oct 8th, 2005, 08:55 PM
#3
Re: VBA to Word
Moved from Classic VB forum. 
So when i = 11 or bookmark 21 you get the error. What is the error message? What is the data for that array element?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|