L
LEU
I have the following macro that will put a Table of Content Marker in the
attachment sections of my document. How do I move the curser to the bottom of
the page before it puts in the marker?
Dim Msg, Style, Title, Response, MyString
Msg = "Do you want a Table of Content Marker?"
Style = vbYesNo + vbDefaultButton2
Title = "Table of Content Marker"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"ADVANCE \y 690", PreserveFormatting:=False
ActiveWindow.ActivePane.View.ShowAll = True
ActiveDocument.TablesOfContents.MarkEntry Range:=Selection.Range,
Entry:= _
TextBox1 & vbTab & TextBox2, EntryAutoText:="", TableID:="C" _
, Level:=2
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Me.Hide
TextBox1.Text = ""
TextBox2.Text = ""
Else
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Me.Hide
TextBox1.Text = ""
TextBox2.Text = ""
End If
attachment sections of my document. How do I move the curser to the bottom of
the page before it puts in the marker?
Dim Msg, Style, Title, Response, MyString
Msg = "Do you want a Table of Content Marker?"
Style = vbYesNo + vbDefaultButton2
Title = "Table of Content Marker"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"ADVANCE \y 690", PreserveFormatting:=False
ActiveWindow.ActivePane.View.ShowAll = True
ActiveDocument.TablesOfContents.MarkEntry Range:=Selection.Range,
Entry:= _
TextBox1 & vbTab & TextBox2, EntryAutoText:="", TableID:="C" _
, Level:=2
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Me.Hide
TextBox1.Text = ""
TextBox2.Text = ""
Else
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Me.Hide
TextBox1.Text = ""
TextBox2.Text = ""
End If