Dear Greg,
great it is working, VERY GOOD JOB, BUT being more or less a novice at
VBA I do not know how to store the value of the second input box in a
second doc variable and then set the default to that variable value. I
tried a couple of things, but to no avail.
As you can see from the below code I integrated your code already but
as I said, the "FootnoteFontPosition" InputBox also needs to be
adressed.
Thank you in advance
Regards,
Andreas
Sub xxx_Format_Footnote_number()
'Your comments:
'Something like this might work:
'Store the value of the input box in a doc variable and then set the
'default to the variable value:
Dim oVar As Variable
Dim FootnoteFontPosition As String
On Error GoTo Err_Handler
Set oVar = ActiveDocument.Variables("Store1")
oVar.Value = InputBox("Enter as value", "Value", oVar.Value)
FootnoteFontPosition = InputBox("Please indicate the position of the
footnote", _
"Position footnote number", 3)
If ActiveWindow.ActivePane.View.Type = wdPrintView Or ActiveWindow. _
ActivePane.View.Type = wdWebView Or
ActiveWindow.ActivePane.View.Type = _
wdPrintPreview Then
ActiveWindow.View.SeekView = wdSeekFootnotes
End If
Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToFirst,
Count:=1, Name:=""
For i = 1 To ActiveDocument.Footnotes.Count
Selection.HomeKey unit:=wdLine
Selection.MoveRight unit:=wdCharacter, Count:=2, Extend:=wdExtend
Selection.Font.Superscript = False
Selection.Font.Size = oVar.Value
Selection.Font.Position = FootnoteFontPosition
Selection.MoveRight unit:=wdCharacter, Count:=1
Selection.GoTo What:=wdGoToFootnote, Which:=wdGoToNext, Count:=1,
Name:=""
Next
Exit Sub
Err_Handler:
If Err.Number = 5825 Then
oVar.Value = "Default value"
Resume
End If
End Sub
Greg Maxey schrieb:
> Something like this might work:
>
[quoted text clipped - 73 lines]
> >
> > Andreas
Greg Maxey - 12 Dec 2006 13:40 GMT
Andreas,
Just repeat for the second variable what you do for the first:
Sub Dipl_Footnote_Number_Format_Separately()
Dim oVar1 As Variable
Dim oVar2 As Variable
Dim FootnoteFontSize As String
Dim FootnoteFontPosition As String
On Error GoTo Err_Handler1
Set oVar1 = ActiveDocument.Variables("Store1")
oVar1.Value = InputBox("Enter as value", "Value", oVar1.Value)
FootnoteFontSize = oVar1.Value
On Error GoTo Err_Handler2
Set oVar2 = ActiveDocument.Variables("Store2")
oVar2.Value = InputBox("Enter as value", "Value", oVar2.Value)
FootnoteFontPosition = oVar2.Value
'Your code to apply the variables defined above
Exit Sub
Err_Handler1:
If Err.Number = 5825 Then
oVar1.Value = "9"
Resume
End If
Exit Sub
Err_Handler2:
If Err.Number = 5825 Then
oVar2.Value = "3"
Resume
End If
End Sub
> Dear Greg,
>
[quoted text clipped - 141 lines]
> > >
> > > Andreas