D
Diamonds_Mine
I need some input on a piece of code. I have information being pulled from
an *.ini file that will make certain changes in the header and footer of the
document if "A4" is the paper size; the code is below. However, this code
does not work if the Word language is set to German because the words
"Header" and "Footer" are different (they are "Kopfzeile" and "Fußzeile").
So I need to know how to have the macro also recognize if Word is using the
German language and tell it to run the same code. Any assistance you can
provide is greatly appreciated. Thank you.
'set A4 paper size for International Offices (also change tabs in Headers
and Footers)
strPaper = System.PrivateProfileString(strOfficeFile, strOffice, "Paper")
If strPaper = "A4" Then
ActiveDocument.PageSetup.PaperSize = wdPaperA4
ActiveDocument.Styles("Header").ParagraphFormat.TabStops.ClearAll
ActiveDocument.Styles("Header").ParagraphFormat.TabStops.Add
Position:= _
InchesToPoints(2.89), Alignment:=wdAlignTabCenter, Leader:= _
wdTabLeaderSpaces
ActiveDocument.Styles("Header").ParagraphFormat.TabStops.Add
Position:= _
InchesToPoints(5.75), Alignment:=wdAlignTabRight, Leader:= _
wdTabLeaderSpaces
ActiveDocument.Styles("Footer").ParagraphFormat.TabStops.ClearAll
ActiveDocument.Styles("Footer").ParagraphFormat.TabStops.Add
Position:= _
InchesToPoints(2.89), Alignment:=wdAlignTabCenter, Leader:= _
wdTabLeaderSpaces
ActiveDocument.Styles("Footer").ParagraphFormat.TabStops.Add
Position:= _
InchesToPoints(5.75), Alignment:=wdAlignTabRight, Leader:= _
wdTabLeaderSpaces
an *.ini file that will make certain changes in the header and footer of the
document if "A4" is the paper size; the code is below. However, this code
does not work if the Word language is set to German because the words
"Header" and "Footer" are different (they are "Kopfzeile" and "Fußzeile").
So I need to know how to have the macro also recognize if Word is using the
German language and tell it to run the same code. Any assistance you can
provide is greatly appreciated. Thank you.
'set A4 paper size for International Offices (also change tabs in Headers
and Footers)
strPaper = System.PrivateProfileString(strOfficeFile, strOffice, "Paper")
If strPaper = "A4" Then
ActiveDocument.PageSetup.PaperSize = wdPaperA4
ActiveDocument.Styles("Header").ParagraphFormat.TabStops.ClearAll
ActiveDocument.Styles("Header").ParagraphFormat.TabStops.Add
Position:= _
InchesToPoints(2.89), Alignment:=wdAlignTabCenter, Leader:= _
wdTabLeaderSpaces
ActiveDocument.Styles("Header").ParagraphFormat.TabStops.Add
Position:= _
InchesToPoints(5.75), Alignment:=wdAlignTabRight, Leader:= _
wdTabLeaderSpaces
ActiveDocument.Styles("Footer").ParagraphFormat.TabStops.ClearAll
ActiveDocument.Styles("Footer").ParagraphFormat.TabStops.Add
Position:= _
InchesToPoints(2.89), Alignment:=wdAlignTabCenter, Leader:= _
wdTabLeaderSpaces
ActiveDocument.Styles("Footer").ParagraphFormat.TabStops.Add
Position:= _
InchesToPoints(5.75), Alignment:=wdAlignTabRight, Leader:= _
wdTabLeaderSpaces