SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > Silent Hunter 4: Wolves of the Pacific > SH4 ATO Mods
Forget password? Reset here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 02-16-10, 02:10 PM   #11
karamazovnew
The Old Man
 
Join Date: Mar 2009
Location: Bucharest, Romania
Posts: 1,403
Downloads: 151
Uploads: 0


Default

BTW, for those who downloaded my tool kit, I've just found that the Word template document no longer had a macro attached. Not sure why, luckily I had posted the macro on another thread so here it is:

All you need to do is create a form with a textbox (txtPage) and a button (btnRenumber). This is all the code you need:

Quote:
Private Sub btnRenumber_Click()
Dim iItem As Integer
Dim myRange As Range
If txtPage.Value = vbNullString Then
MsgBox "You must enter the Menu Page"
ElseIf Application.Documents.Count < 1 Then
MsgBox "No document Opened"
Else
iItem = 1
Set myRange = ActiveDocument.Range(Start:=0, End:=ActiveDocument.Content.End)
myRange.Select
With Selection.Find
.Forward = True
.Wrap = wdFindStop
.Text = "[" + txtPage.Value + " I"
Do While .Execute
Selection.Extend
Selection.Extend
Selection.Extend
Selection.TypeText Text:="[" + UCase(txtPage.Value) + " I" + CStr(iItem) + "]"
iItem = iItem + 1
Set myRange = ActiveDocument.Range(Start:=Selection.End, End:=ActiveDocument.Content.End)
myRange.Select
Loop
End With
End If
End Sub
To use it, just type the name of the menu page you want to renumber. For example: G26. Note that you must make sure that all new items in that page begin with G26.

Good:
Quote:
[G26 I235]
[G26 I245]
[G26 I90]
BAD:
Quote:
[G26 I235]
[G25 I245]
[G26 I90]
karamazovnew is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Forum Jump


All times are GMT -5. The time now is 01:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 1995- 2026 Subsim®
"Subsim" is a registered trademark, all rights reserved.