Plantilla de Word con una caracteristica especial

04/06/2007 - 23:23 por Rafael Reyes | Informe spam
Soy un programador joven y tengo una inquietud, alguien me podria indicar
como hago yo para crear un macro en un modulo que diga lo siguiente:
tengo 1 tabla con 3 filas, en la primera es el nombre de lo que hay en
frente... en la segunda la numeracion algo asi:
1 Fila 2Fila 3 Fila
Nombre: 1- nombre 1nivel
2- nombre 1nivel
2.1. - nombre 2 nivel
2.1.1. - nombre 3 nivel -(que aparesca
este -)
2.1.2. - Nombre 3 Nivel2 -(que aparesca
este -)

Nombre2: 3- nombre 1nivel
3.1. - nombre 2 nivel
3.1.1. - nombre 3 nivel -(que aparesca
este -)
3.1.2. - Nombre 3 Nivel2 -(que aparesca
este -)

El asunto es programar en codigo que realize un chequeo de cada nivel los
que tengan el nivel mas alto en este caso 3 Nivel colocar un guion en la
tercera fila...
porfavor ayuda
Rafael Reyes G.

Preguntas similare

Leer las respuestas

#1 Tux
08/06/2007 - 20:10 | Informe spam
Rafael Reyes escribió:

el asunto es que necesito un codigo que verifique los niveles de numeracion
que los tengo vinculados a un estilo de linea...




Hola RAfael :)

Como te he comentado en el mail :-( me es imposible realizar tu
necesidad [so pena :-( de saber menos de lo que me gustaria saber ], si
encontraras la solucion porfavor agradeceria que me la comentaras :)
y espero que en la proxima si pueda ayudarte :)

Saludos Cordiales
Monica





Estado: A la Espera By Fermu

Tic-Tac-Tic-Tac...

Now We are free [Enya]

www.fermu.com
Respuesta Responder a este mensaje
#2 Rafael Reyes
13/06/2007 - 16:57 | Informe spam
Bueno paso el codigo... en principio un amigo me envio una solucion pero
funciona en Word 2003 En ingles pero en el español No me sirve...

El problema radica en la declaración Sort_Step_Info

en esta linea:

' **** Sort the Table based on the page (2nd column)and line number (3rd
Column)
Selection.Tables(1).Select

Selection.Sort ExcludeHeader:=False, FieldNumber:="Column 2", _
SortFieldType:=wdSortFieldNumeric, SortOrder:=wdSortOrderAscending, _
FieldNumber2:="Column 3", SortFieldType2:=wdSortFieldNumeric, SortOrder2 _
:=wdSortOrderAscending, FieldNumber3:="", SortFieldType3:= _
wdSortFieldAlphanumeric, SortOrder3:=wdSortOrderAscending, Separator:= _
wdSortSeparateByTabs, SortColumn:=False, CaseSensitive:=False,
LanguageID _
:=wdLanguageNone




Miren este es el codigo del modulo...



' **** Template/Module: ProcTB3
' ******************************************

Private Count As Integer
' ******************************************
' **********************************************************

Public Sub FixNumbersAndBullets()
' ** Purpose: Clean up the numbers that precede the steps, substeps, and
' ** SubSubSteps. The template incorporates the Word 8.0 numbering
' ** feature in the styles.
' ** If for some reason the developer has unnumbered a component,
' ** this macro will reset the numbering.
' ** If components include manually entered numbers, this macro will
' ** remove these.

Dim Current_Style As String
Dim StepText As String
Dim TabLocation As Integer
Dim i As Integer
Dim CurrentView As Integer

' **** Find current view and reset to 50
CurrentView = ActiveWindow.ActivePane.View.Zoom.Percentage
ActiveWindow.ActivePane.View.Zoom.Percentage = 50

' **** Mark the cursor position. The cursor will be returned to this
' **** location when the macro is complete.

' **** If the cursor is in a table, ensure it is not in
' **** a location where the bookmark may be deleted
If Selection.Information(wdWithInTable) Then
Selection.HomeKey Unit:=wdRow
End If

' **** Insert the bookmark
Call Cursor_Location("Mark")

' **** Move the cursor to the first occurrence of style "* Step"
Selection.HomeKey Unit:=wdStory


' **** Reset the Number format (Pulldown equivalent is : Modify
Format:BulletsAndNumbering)
If Find_Style("* Step") Then
Call ResetProcedureNumberFormat("* Step", 1, "%1.", 0, 0.35)
Call ResetProcedureNumberFormat("* SubStep", 2, "%1.%2", 0.35, 0.75)
Call ResetProcedureNumberFormat("* SubSubStep", 3, "%1.%2.%3", 0.75, 1.4)

' **** Reset all other numbering levels (no number, no indent)
' **** For i = 4 to 9
For i = 4 To 9

Call ResetProcedureNumberFormat("", i, "", 0, 0)

Next i

' **** Apply changes to the document
' **** Reset the NumberGallery
ListGalleries(wdOutlineNumberGallery).ListTemplates(1).Name = ""

' ** This series of commands must be implemented twice
' ** First time, number is eliminated
' ** Second time inserts the number
Selection.Range.ListFormat.ApplyListTemplate
ListTemplate:=ListGalleries( _
wdOutlineNumberGallery).ListTemplates(1), ContinuePreviousList:=False,
ApplyTo:= _
wdListApplyToSelection

Selection.Range.ListFormat.ApplyListTemplate
ListTemplate:=ListGalleries( _
wdOutlineNumberGallery).ListTemplates(1), ContinuePreviousList:=False,
ApplyTo:= _
wdListApplyToSelection

End If

' **** Reset format of all bullet items in the procedure

' **** Reset "* Fwd Text w/Bullet"
Selection.HomeKey Unit:=wdStory
If Find_Style("* Fwd Text w/Bullet") = True Then
Call ResetBulletFormat("* Fwd Text w/Bullet", 1, 0, 0.25)
End If


' **** Reset "* Fwd Text w/SubBullet"
Selection.HomeKey Unit:=wdStory
If Find_Style("* Fwd Text w/SubBullet") = True Then
Call ResetBulletFormat("* Fwd Text w/SubBullet", 2, 0.25, 0.5)

End If

' **** Find style "* BulletStep"
Selection.HomeKey Unit:=wdStory
If Find_Style("* BulletStep") = True Then
Call ResetBulletFormat("* BulletStep", 3, 0.35, 0.75)
End If

' **** Find style BulletSubStep "and reset"
Selection.HomeKey Unit:=wdStory
If Find_Style("* BulletSubStep") = True Then
Call ResetBulletFormat("* BulletSubStep", 4, 0.75, 1#)
End If

' **** Find style BulletSubSubStep "and reset"
Selection.HomeKey Unit:=wdStory
If Find_Style("* BulletSubSubStep") = True Then
Call ResetBulletFormat("* BulletSubSubStep", 5, 1#, 1.25)
End If

' **** Find style BoldFace Step "and reset"
Selection.HomeKey Unit:=wdStory
If Find_Style("*** BF Step") = True Then
Call ResetBulletFormat("*** BF Step", 5, 0, 0.25)
End If

' **** Find style BulletSubStep "and reset"
Selection.HomeKey Unit:=wdStory
If Find_Style("* Attachment") = True Then
Call ResetBulletFormat("* Attachment", 5, 0, 0.25)
End If

' **** Loop to find each location of each number and bullet styles
For i = 1 To 8
' **** Put cursor at beginning of document
Selection.HomeKey Unit:=wdStory

' **** Select Case to assign one of the seven styles
' ** This is in preparation for the find process.
Select Case i
Case 1
Current_Style = "* Step"
Case 2
Current_Style = "* SubStep"
Case 3
Current_Style = "* SubSubStep"
Case 4
Current_Style = "* Fwd Text w/Bullet"
Case 5
Current_Style = "* Fwd Text w/SubBullet"
Case 6
Current_Style = "* BulletStep"
Case 7
Current_Style = "* BulletSubStep"
Case 8
Current_Style = "*** BF Step"
End Select

' **** Loop to find each occurence of the Current_Style and fix any
problems.
Do While Find_Style(Current_Style) = True

' **** Delete any manually entered numbers and bullets
' **** Load the selected text into the variable "StepText"
StepText = Selection()

' **** Locate the position of the tab if there is one.
' ** Assume any manually entered step number or bullet is
followed by a tab.
TabLocation = InStr(1, StepText, Chr$(9))

' **** Unhilite current text and move cursor to beginning of line
Selection.HomeKey Unit:=wdLine

' ****Ensure the tab found is associated with a number or bullet.
' ** Assume a tab within the first 10
' ** characters is associated with a number or a bullet.
If (TabLocation > 1) And (TabLocation < 10) Then
' **** Hilite from beginning through the tab and delete.
Selection.MoveRight Unit:=wdCharacter, Count:=TabLocation,
Extend:=wdExtend
Selection.Delete Unit:=wdCharacter, Count:=1
End If

' ** Reassign the style, this will ensure that a number or bullet
appear
Selection.Style = ActiveDocument.Styles(Current_Style)

' ** Position the cursor in preparation for the next find.
If Selection.Information(wdWithInTable) Then
Selection.EndKey Unit:=wdRow, Extend:=True
Selection.MoveRight Unit:=wdCharacter, Count:=1
Else
MsgBox ("Format error: Expected to find this component in a
table." + _
vbCr + "Move this component into a table or assign a
normal style to it.")

' **** Set view back to original setting
ActiveWindow.ActivePane.View.Zoom.Percentage = CurrentView
Exit Sub
End If
Loop
Next i

' **** Return the cursor to its initial location and delete bookmark.
Call Cursor_Location("Return")

' **** Set view back to original setting
ActiveWindow.ActivePane.View.Zoom.Percentage = CurrentView

End Sub
' **********************************************************
' **********************************************************

Private Sub ResetProcedureNumberFormat(StyleOfNumber As String, NumberLevel
As Integer, _
NumberCode As String, PosOfNumber As Single, PosOfTextAndTab As Single)

' **** Set the Number format
With
ListGalleries(wdOutlineNumberGallery).ListTemplates(1).ListLevels(NumberLevel)

' **** Establish Position of Number in Hierarchy
.NumberFormat = NumberCode
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleArabic

' **** Set the position of the number from left border
.NumberPosition = InchesToPoints(PosOfNumber)
.Alignment = wdListLevelAlignLeft

' **** Set the distance from the left margin to the second line of text
.TextPosition = InchesToPoints(PosOfTextAndTab)

' **** Set the distance between left margin to the first line of text
.TabPosition = InchesToPoints(PosOfTextAndTab)
.ResetOnHigher = True
.StartAt = 1

' **** Ensure the font style of the number is correct
With .Font
.Bold = False
.Italic = False
.Size = 12
.Name = "Arial"

End With

' **** Link this setting to the style within the style list
.LinkedStyle = StyleOfNumber
End With

End Sub
' ****************************************************
' ****************************************************

Public Sub ResetBulletFormat(StyleOfBullet As String, PosInBulletGallery As
Integer, _
PosOfNumber, PosOfTextAndTab)
' ** Purpose: To reset the bullet format for a selected style.
' ** The pulldown toolbar equivalent is ==> Format:BulletsAndNumbering:Bullets
' ** Parameters passed to the "ResetBulletFormat" subroutine are:
' ** * Style
' ** * Position of this bullet style in the bullet gallery
' ** * Position of the bullet from left border
' ** * Distance of the text from the left border

' **** Set the bullet format
With
ListGalleries(wdBulletGallery).ListTemplates(PosInBulletGallery).ListLevels(1)

' **** Assigns bullet symbol from "Symbol Collection"
.NumberFormat = "•"
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleBullet

' **** Set the position of the bullet from left border
.NumberPosition = InchesToPoints(PosOfNumber)
.Alignment = wdListLevelAlignLeft

' **** Set the distance of the second line of text from left border
.TextPosition = InchesToPoints(PosOfTextAndTab)

' **** Set the distance of the first line of text from left border
.TabPosition = InchesToPoints(PosOfTextAndTab)
.ResetOnHigher = True
.StartAt = 1
With .Font
.Bold = True
.Size = 16
.Name = "Times New Roman"
End With

' **** Link this setting to the style
.LinkedStyle = StyleOfBullet
End With

' **** Reset the Bullet Gallery
ListGalleries(wdBulletGallery).ListTemplates(PosInBulletGallery).Name = ""

Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=ListGalleries( _
wdBulletGallery).ListTemplates(PosInBulletGallery), _
ContinuePreviousList:=False, ApplyTo:=wdListApplyToSelection

Selection.Range.ListFormat.ApplyListTemplate ListTemplate:=ListGalleries( _
wdBulletGallery).ListTemplates(PosInBulletGallery), _
ContinuePreviousList:=False, ApplyTo:=wdListApplyToSelection

End Sub
' ****************************************************
' ****************************************************

Public Sub UpdateSignOffs()
' ** Purpose: Delete all signoffs in the third column
' ** and then enter new signoffs to all step, substep,
' ** subsubstep, bulletstep, and bulletsubstep except when:
' ** If step is followed by a substep or bulletstep
' ** If substep is followed by subsubstep or bulletsubstep

' **** Declarations
Dim Current_Style As String
Dim StepText As String
Dim TabLocation As Integer
Dim i As Integer
Dim SignOffNeeded As Boolean

' ** This macro uses the public array "StepInfo". The 3 columns
' ** are used as follows.
' ** 1 -- Style of the component ("* Step", "* Substep", or "* SubSubStep")
' ** 2 -- Page number of style; Integer
' ** 3 -- Line number of style; Integer

' **** Find current view and reset to 50
CurrentView = ActiveWindow.ActivePane.View.Zoom.Percentage
ActiveWindow.ActivePane.View.Zoom.Percentage = 50

' **** Mark the cursor position.
' ** The cursor will be returned to this
' ** location when the macro is complete.

' **** If the cursor is in a table, ensure it is not in
' **** the signOff column
' ** NOTE: This macro deletes contents of the signoff column.
If Selection.Information(wdWithInTable) Then
Selection.HomeKey Unit:=wdRow
End If

' **** Insert the bookmark
Call Cursor_Location("Mark")


' **** Add the checkoffs to the prerequisite section


' **** Initialize count
' ** This variable counts the total number of steps, substeps and subsubsteps.
Count = 0

' **** Loop for each style type
'For i = 1 To 5
For i = 1 To 12


' **** Put cursor at beginning of document
Selection.HomeKey Unit:=wdStory

' ** Assign the next style in preparation for the find process.
Select Case i
Case 1
Current_Style = "* KE Step"
Case 2
Current_Style = "* KE SubStep"
Case 3
Current_Style = "* KE SubSubStep"
Case 4
Current_Style = "* KE BulletStep"
Case 5
Current_Style = "* KE BulletSubStep"
Case 6
Current_Style = "* KE BulletSubSubStep"
Case 7
Current_Style = "* PE Step"
Case 8
Current_Style = "* PE SubStep"
Case 9
Current_Style = "* PE SubSubStep"
Case 10
Current_Style = "* PE BulletStep"
Case 11
Current_Style = "* PE BulletSubStep"
Case 12
Current_Style = "* PE BulletSubSubStep"


End Select

' **** Find each occurence of the Current_Style and fix any problems.
Do While Find_Style(Current_Style) = True

' ** Function "Find_Style" finds next occurence of "Current_Style"
' ** If it finds an occurence, add a row to the "Step_Info" array

'**** Unhilite current text and move cursor to beginning of line
Selection.HomeKey Unit:=wdLine

' **** Get the information associated with the current component
StepInfo(1, Count) = Current_Style
StepInfo(2, Count) = Selection.Information(wdActiveEndPageNumber)
StepInfo(3, Count) = Selection.Information(wdFirstCharacterLineNumber)

' **** Increment the array row counter
Count = Count + 1

' ** Position the cursor in preparation for the next find.
If Selection.Information(wdWithInTable) Then
Selection.EndKey Unit:=wdRow, Extend:=True
Selection.MoveRight Unit:=wdCharacter, Count:=1
Else
MsgBox ("Format error: Expected to find this component in a
table.")

' **** Set view back to original setting
ActiveWindow.ActivePane.View.Zoom.Percentage = CurrentView
Exit Sub
End If
Loop
Next i

Selection.HomeKey Unit:=wdStory

' **** Ensure there are at least 2 components in the array
' ** NOTE: If there are 0 or 1 components the sort macro bombs.
If Count < 2 Then
MsgBox ("There are less than 2 properly formatted components that
require" + _
" sign-offs in this document. Operation cancelled.")
End If

If Count > 1 Then
' **** Call Sort_Step_Info (Subroutine)
' ** This sorts the "StepInfo" array based on page and line numbers
Call Sort_Step_Info

' ** The next loop determines if a signoff is appropriate for each
component.
' ** When appropriate the signoff is added,
' ** if it is not appropriate, the signoff cell is cleared.

' **** Loop to address each component in the "StepInfo" array
For i = 0 To (Count - 2)
' ** This loop addresses all but the last component in the array.
' ** The last component always has a signoff.

'** Initialize the SignOff Flag
SignOffNeeded = True

' **** Determine if SignOff is not needed for the current component
' ** The following two statements cover the only situations when
' ** a sign off line is not appropriate.
If StepInfo(1, i) = "* KE Step" And (StepInfo(1, i + 1) = "* KE
SubStep" Or _
StepInfo(1, i + 1) = "* KE BulletStep") Then
SignOffNeeded = False
End If

If StepInfo(1, i) = "* KE SubStep" And (StepInfo(1, i + 1) = "* KE " _
+ "SubSubStep" Or StepInfo(1, i + 1) = "* KE BulletSubStep") Then
SignOffNeeded = False
End If

If StepInfo(1, i) = "* KE SubSubStep" And (StepInfo(1, i + 1) = "*
KE " _
+ "BulletSubSubStep") Then
SignOffNeeded = False
End If

If StepInfo(1, i) = "* KE BulletStep" And (StepInfo(1, i + 1) = "*
KE " _
+ "BulletSubStep" Or StepInfo(1, i + 1) = "* KE SubSubStep") Then
SignOffNeeded = False
End If

If StepInfo(1, i) = "* KE BulletSubStep" And (StepInfo(1, i + 1) =
"* KE " _
+ "BulletSubSubStep") Then
SignOffNeeded = False
End If

If StepInfo(1, i) = "* PE Step" And (StepInfo(1, i + 1) = "* PE
SubStep" Or _
StepInfo(1, i + 1) = "* PE BulletStep") Then
SignOffNeeded = False
End If

If StepInfo(1, i) = "* PE SubStep" And (StepInfo(1, i + 1) = "* PE " _
+ "SubSubStep" Or StepInfo(1, i + 1) = "* PE BulletSubStep") Then
SignOffNeeded = False
End If

If StepInfo(1, i) = "* PE SubSubStep" And (StepInfo(1, i + 1) = "*
PE " _
+ "BulletSubSubStep") Then
SignOffNeeded = False
End If

If StepInfo(1, i) = "* PE BulletStep" And (StepInfo(1, i + 1) = "*
PE " _
+ "BulletSubStep" Or StepInfo(1, i + 1) = "* PE SubSubStep") Then
SignOffNeeded = False
End If

If StepInfo(1, i) = "* PE BulletSubStep" And (StepInfo(1, i + 1) =
"* PE " _
+ "BulletSubSubStep") Then
SignOffNeeded = False
End If


' **** Position cursor on the appropriate line
Call GoToPageAndLine(StepInfo(2, i), StepInfo(3, i))

' **** Move cursor to right most column, hilite contents and delete
Selection.EndKey Unit:=wdRow
Selection.MoveLeft Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.Delete Unit:=wdCharacter, Count:=1

' **** If signoff is needed, insert it.
If SignOffNeeded = True Then
Selection.Style = ActiveDocument.Styles("*** Signoff")
Selection.TypeText Text:="____"
End If
Next i

' **** Insert signoff for the last component in the procedure.
Call GoToPageAndLine(StepInfo(2, (Count - 1)), StepInfo(3, (Count - 1)))
Selection.EndKey Unit:=wdRow
Selection.MoveLeft Unit:=wdCell
Selection.MoveRight Unit:=wdCell
' ** The contents in the signoff column are hilited at this point

Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Style = ActiveDocument.Styles("*** Signoff")
Selection.TypeText Text:="____"
End If

' **** Return the cursor to its initial location and delete bookmark.
Call Cursor_Location("Return")

' **** Set view back to original setting
ActiveWindow.ActivePane.View.Zoom.Percentage = CurrentView

End Sub
' **********************************************************
' **********************************************************

Private Sub Sort_Step_Info()
' ** Purpose: Sort the information in the array "Step_Info"
' ** The sort is based on the page and line number components in the
' ** for each component.
' ** This procedure:
' ** * Turns off the screen update
' ** * Opens up a temporary word document
' ** * Writes the array contents into a table
' ** * Sorts the table based on the Page and Line numbers
' ** * Reloads the data into the array
' ** * Closes the document without saving it
' ** * Turns on the screen update

' **** Turn off the screen Update
Application.ScreenUpdating = False

' **** Open a temporary word document
Call Find_Template_Path

Documents.Add Template:=Template_Path + "\" + Procedure_Template

' **** Ensure there is no existing material in the tempate
Selection.WholeStory
Selection.Delete Unit:=wdCharacter, Count:=1

' **** Create the table
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=2, NumColumns:= _
3

' **** Loop to Write the array contents into a table
For j = 0 To (Count - 1)

' **** Insert the style
Selection.Text = StepInfo(1, j)
Selection.MoveRight Unit:=wdCell

' **** Insert the page number
Selection.Text = Str(StepInfo(2, j))
Selection.MoveRight Unit:=wdCell

' **** Insert the line number
Selection.Text = Str(StepInfo(3, j))
Selection.MoveRight Unit:=wdCell
Next j

' **** Delete the blank row created by the last cell move command
Selection.SelectRow
Selection.Rows.Delete

Selection.MoveUp Unit:=wdLine, Count:=1

' **** Sort the Table based on the page (2nd column)and line number (3rd
Column)
Selection.Tables(1).Select

Selection.Sort ExcludeHeader:=False, FieldNumber:="Column 2", _
SortFieldType:=wdSortFieldNumeric, SortOrder:=wdSortOrderAscending, _
FieldNumber2:="Column 3", SortFieldType2:=wdSortFieldNumeric, SortOrder2 _
:=wdSortOrderAscending, FieldNumber3:="", SortFieldType3:= _
wdSortFieldAlphanumeric, SortOrder3:=wdSortOrderAscending, Separator:= _
wdSortSeparateByTabs, SortColumn:=False, CaseSensitive:=False,
LanguageID _
:=wdLanguageNone

' **** Reload the data into the array
' **** Select the contents of the first cell
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCell
Selection.MoveLeft Unit:=wdCell

' **** Reload the array
For j = 0 To (Count - 1)
StepInfo(1, j) = Selection.Text
Selection.MoveRight Unit:=wdCell
StepInfo(2, j) = Val(Selection.Text)
Selection.MoveRight Unit:=wdCell
StepInfo(3, j) = Val(Selection.Text)
Selection.MoveRight Unit:=wdCell
Next j

' **** Close the document without saving it
ActiveWindow.Close (wdDoNotSaveChanges)

' **** Turn on the Screen Update
Application.ScreenUpdating = True

End Sub
' **********************************************************
' **********************************************************

Private Sub GoToPageAndLine(PageNumber, LineNumber)
' ** Purpose: To position the cursor at the page and line number

Dim CurrentPage As Integer
Dim CurrentLine As Integer

' **** Ensure cursor is on page: PageNumber
CurrentPage = Selection.Information(wdActiveEndPageNumber)

If (PageNumber <> CurrentPage) Then
Selection.GoTo What:=wdGoToPage, Which:=wdGoToNext,
Name:=PageNumber
End If

' **** Move cursor to LineNumber
CurrentLine = Selection.Information(wdFirstCharacterLineNumber)

Do While (LineNumber <> CurrentLine)

Selection.MoveDown Unit:=wdLine, Count:=1
CurrentLine = Selection.Information(wdFirstCharacterLineNumber)
Loop

End Sub
' *********************************************************
' **********************************************************

Public Function Find_Style(Cur_Style As String) As Boolean
' ** Purpose: Locate the next occurrence of "Cur_Style". If the current
' ** style is found, return a true value in Find_Style.

' **** Set the default value for the function value
Find_Style = False

' **** If the style is not available in the style list
' **** skip over the rest of the macro and return a "False" value
On Error GoTo ErrorHandler

With Selection
With .Find
.ClearFormatting
.Style = ActiveDocument.Styles(Cur_Style)
.Text = ""
.Forward = True
.Wrap = wdFindStop
' ** Do not wrap around to beginning of document

.Format = True
End With
.Find.Execute

' ** Set the Function's Boolean value to "true" or "false"
If .Find.Found = True Then
Find_Style = True
End If

End With

ErrorHandler:

End Function
' **********************************************
' **********************************************
Respuesta Responder a este mensaje
#3 Tux
13/06/2007 - 20:39 | Informe spam
Rafael Reyes escribió:
Bueno paso el codigo... en principio un amigo me envio una solucion pero
funciona en Word 2003 En ingles pero en el español No me sirve...

El problema radica en la declaración Sort_Step_Info

en esta linea:

' **** Sort the Table based on the page (2nd column)and line number (3rd
Column)
Selection.Tables(1).Select




Hola Rafael :)

La virgen que peazo codigo :-O !! dejamer mirarme esto que mañna por la
mañana la tengo libre y te comento por la tarde mañana ok? :-) y asi me
miro yo esto mas despacio :-)

Y gracias Rafael ;-) ya mañana te comento algo :-) !!

Saludos
Monica




Estado: A la Espera By Fermu

Tic-Tac-Tic-Tac...

Now We are free [Enya]

www.fermu.com
Respuesta Responder a este mensaje
#4 Rafael Reyes
13/06/2007 - 20:52 | Informe spam
Y eso que solo es el primer modulo... son 6
Rafael Reyes G.


"Tux" escribió:

Rafael Reyes escribió:
> Bueno paso el codigo... en principio un amigo me envio una solucion pero
> funciona en Word 2003 En ingles pero en el español No me sirve...
>
> El problema radica en la declaración Sort_Step_Info
>
> en esta linea:
>
> ' **** Sort the Table based on the page (2nd column)and line number (3rd
> Column)
> Selection.Tables(1).Select
>

Hola Rafael :)

La virgen que peazo codigo :-O !! dejamer mirarme esto que mañna por la
mañana la tengo libre y te comento por la tarde mañana ok? :-) y asi me
miro yo esto mas despacio :-)

Y gracias Rafael ;-) ya mañana te comento algo :-) !!

Saludos
Monica




Estado: A la Espera By Fermu

Tic-Tac-Tic-Tac...

Now We are free [Enya]

www.fermu.com










Respuesta Responder a este mensaje
#5 Tux
14/06/2007 - 00:16 | Informe spam
Rafael Reyes escribió:
Y eso que solo es el primer modulo... son 6



Por dios :-O !! vale guai !!! empezaremos por el primer modulo e iremos
subiendo :-P jejejeje! mañana por la mañana pues me pongo a mirar este
codigo y ya comento ok? :-)

Saludos
Monica


Estado: A la Espera By Fermu

Tic-Tac-Tic-Tac...

Now We are free [Enya]

www.fermu.com
Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaSiguiente Respuesta Tengo una respuesta
Search Busqueda sugerida