VBA Snippets


Animation

Returns the animation type (in full) given an abbreviation.
Public Function zReturn_Animation(sAnimationKey As String) As String
Dim ltemporary As Long
Select Case sAnimationKey
Case "NO": ltemporary = wdAnimationNone
Case "BBG": ltemporary = wdAnimationBlinkingBackground
Case "LVL": ltemporary = wdAnimationLasVegasLights
Case "MBA": ltemporary = wdAnimationMarchingBlackAnts
Case "MRA": ltemporary = wdAnimationMarchingRedAnts
Case "SHM": ltemporary = wdAnimationShimmer
Case "SPK": ltemporary = wdAnimationSparkleText
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_Animation", _
"Incorrect Row Height abbreviation : " & sAnimationKey)
If gbDEBUG = False Then Exit Select
zReturn_Animation = ltemporary
End Function

CaptionPosition

Returns the caption position (in full) given an abbreviation.
Public Function zReturn_CaptionPosition(sCaptionPositionKey As String) As String
Dim ltemporary As Long
Select Case sCaptionPositionKey
Case "AB": ltemporary = wdCaptionPositionAbove
Case "BL": ltemporary = wdCaptionPositionBelow
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_CaptionPosition", _
"Incorrect Caption Position abbreviation : " & sCaptionPositionKey)
End Select
zReturn_CaptionPosition = ltemporary
End Function

DefaultStyle

Returns the type of style (in full) given an abbreviation.
Public Function zReturn_DefaultStyle(sDefaultStyleKey As String) As Long
Dim ltemporary As Long
Select Case sDefaultStyleKey
Case "BLQ": ltemporary = wdStyleBlockQuotation
Case "BT": ltemporary = wdStyleBodyText
Case "BT1": ltemporary = wdStyleBodyText2
Case "BT2": ltemporary = wdStyleBodyText3
Case "BTFI": ltemporary = wdStyleBodyTextFirstIndent
Case "BTFI2": ltemporary = wdStyleBodyTextFirstIndent2
Case "BTI": ltemporary = wdStyleBodyTextIndent
Case "BTI2": ltemporary = wdStyleBodyTextIndent2
Case "BTI3": ltemporary = wdStyleBodyTextIndent3
Case "CAP": ltemporary = wdStyleCaption
Case "CLO": ltemporary = wdStyleClosing
Case "CMRF": ltemporary = wdStyleCommentReference
Case "CMT": ltemporary = wdStyleCommentText
Case "DTE": ltemporary = wdStyleDate
Case "DPAF": ltemporary = wdStyleDefaultParagraphFont
Case "EMP": ltemporary = wdStyleEmphasis
Case "ERF": ltemporary = wdStyleEndnoteReference
Case "ET": ltemporary = wdStyleEndnoteText
Case "ENA": ltemporary = wdStyleEnvelopeAddress
Case "ENR": ltemporary = wdStyleEnvelopeReturn
Case "FT": ltemporary = wdStyleFooter
Case "FTRF": ltemporary = wdStyleFootnoteReference
Case "FTT": ltemporary = wdStyleFootnoteText
Case "HD": ltemporary = wdStyleHeader
Case "HD1": ltemporary = wdStyleHeading1
Case "HD2": ltemporary = wdStyleHeading2
Case "HD3": ltemporary = wdStyleHeading3
Case "HD4": ltemporary = wdStyleHeading4
Case "HD5": ltemporary = wdStyleHeading5
Case "HD6": ltemporary = wdStyleHeading6
Case "HD7": ltemporary = wdStyleHeading7
Case "HD8": ltemporary = wdStyleHeading8
Case "HD9": ltemporary = wdStyleHeading9
Case "HYP": ltemporary = wdStyleHyperlink
Case "HYPF": ltemporary = wdStyleHyperlinkFollowed
Case "IDX1": ltemporary = wdStyleIndex1
Case "IDX2": ltemporary = wdStyleIndex2
Case "IDX3": ltemporary = wdStyleIndex3
Case "IDX4": ltemporary = wdStyleIndex4
Case "IDX5": ltemporary = wdStyleIndex5
Case "IDX6": ltemporary = wdStyleIndex6
Case "IDX7": ltemporary = wdStyleIndex7
Case "IDX8": ltemporary = wdStyleIndex8
Case "IDX9": ltemporary = wdStyleIndex9
Case "IDXH": ltemporary = wdStyleIndexHeading
Case "LNU": ltemporary = wdStyleLineNumber
Case "LST": ltemporary = wdStyleList
Case "LST2": ltemporary = wdStyleList2
Case "LST3": ltemporary = wdStyleList3
Case "LST4": ltemporary = wdStyleList4
Case "LST5": ltemporary = wdStyleList5
Case "LSTB": ltemporary = wdStyleListBullet
Case "LSTB2": ltemporary = wdStyleListBullet2
Case "LSTB3": ltemporary = wdStyleListBullet3
Case "LSTB4": ltemporary = wdStyleListBullet4
Case "LSTB5": ltemporary = wdStyleListBullet5
Case "LSTC": ltemporary = wdStyleListContinue
Case "LSTC2": ltemporary = wdStyleListContinue2
Case "LSTC3": ltemporary = wdStyleListContinue3
Case "LSTC4": ltemporary = wdStyleListContinue4
Case "LSTC5": ltemporary = wdStyleListContinue5
Case "LSTN": ltemporary = wdStyleListNumber
Case "LSTN2": ltemporary = wdStyleListNumber2
Case "LSTN3": ltemporary = wdStyleListNumber3
Case "LSTN4": ltemporary = wdStyleListNumber4
Case "LSTN5": ltemporary = wdStyleListNumber5
Case "MACT": ltemporary = wdStyleMacroText
Case "MSGH": ltemporary = wdStyleMessageHeader
Case "NCPN": ltemporary = wdStyleNavPane
Case "NRML": ltemporary = wdStyleNormal
Case "NRMLI": ltemporary = wdStyleNormalIndent
Case "NTHD": ltemporary = wdStyleNoteHeading
Case "PGNU": ltemporary = wdStylePageNumber
Case "PLT": ltemporary = wdStylePlainText
Case "SAL": ltemporary = wdStyleSalutation
Case "SIG": ltemporary = wdStyleSignature
Case "STR": ltemporary = wdStyleStrong
Case "SUBT": ltemporary = wdStyleSubtitle
Case "TOAU": ltemporary = wdStyleTableOfAuthorities
Case "TOFG": ltemporary = wdStyleTableOfFigures
Case "TITL": ltemporary = wdStyleTitle
Case "TOAH": ltemporary = wdStyleTOAHeading
Case "TOC1": ltemporary = wdStyleTOC1
Case "TOC2": ltemporary = wdStyleTOC2
Case "TOC3": ltemporary = wdStyleTOC3
Case "TOC4": ltemporary = wdStyleTOC4
Case "TOC5": ltemporary = wdStyleTOC5
Case "TOC6": ltemporary = wdStyleTOC6
Case "TOC7": ltemporary = wdStyleTOC7
Case "TOC8": ltemporary = wdStyleTOC8
Case "TOC9": ltemporary = wdStyleTOC9
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_DefaultSyle", _
"Incorrect Default Style abbreviation : " & sDefaultStyleKey)
End Select
zReturn_DefaultStyle = ltemporary
End Function

DistanceFrom

Returns the border distance (in full) given an abbreviation 'Returns or sets a value that indicates whether the specified page border is 'measured from the edge of the page or from the text it surrounds.
Public Function zReturn_DistanceFrom(sDistanceFromKey As String) As Long
Dim ltemporary As Long
Select Case sDistanceFromKey
Case "FPE": ltemporary = wdBorderDistanceFromPageEdge
Case "FTX": ltemporary = wdBorderDistanceFromText
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_DistanceFrom", _
"Incorrect Border Distance abbreviation : " & sDistanceFromKey)
End Select
zReturn_DistanceFrom = ltemporary
End Function

FontName

Returns the font name (in full) given an abbreviation.
Public Function zReturn_FontName(sFontNameKey As String) As String
Dim stemporary As String
Select Case sFontNameKey
Case "UN": stemporary = "Univers"
Case "UL": stemporary = "UniversLight"
Case "AR": stemporary = "Arial"
Case "TN": stemporary = "Times New Roman"
Case "HL": stemporary = "Helvetica"
Case "AN": stemporary = "Arial Narrow"
Case "SB": stemporary = "Sabon"
Case "MS": stemporary = "Monotype sorts"
Case "VB": stemporary = "VerticaBlack"
Case "": stemporary = ""
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_FontName", _
"Incorrect Font Name abbreviation : " & sFontNameKey)
End Select
zReturn_FontName = stemporary
End Function

General_Pause

Pauses a macro for a number of seconds.
Public Sub General_Pause(iPauseSeconds As Integer, _
Optional bChangeStatusBar As Boolean = True)
Dim Start As Date
On Error GoTo AnError
If bChangeStatusBar = True Then _
Application.StatusBar = "Macro has been paused for " & iPauseSeconds & " seconds ..."
Application.Cursor = xlWait
Start = Timer
Do While Timer < Start + iPauseSeconds
DoEvents
Loop
Application.Cursor = xlDefault

If bChangeStatusBar = True Then Application.StatusBar = False
If gbDEBUG = False Then Exit Sub
AnError:
Call Error_Handle("Pause", msMODULENAME, 1, _
"pause the macro for """ & iPauseSeconds & """ seconds")
End Sub

LanguageID

Returns the language ID (in full) given an abbreviation.
Public Function zReturn_LanguageID(sLanguageIDKey As String) As Long
Dim ltemporary As Long
Select Case sLanguageIDKey
Case "NO": ltemporary = wdNoProofing
Case "NONE": ltemporary = wdLanguageNone
Case "AFR": ltemporary = wdAfrikaans
Case "ARA": ltemporary = wdArabic
Case "BAS": ltemporary = wdBasque
Case "BELD": ltemporary = wdBelgianDutch
Case "BELF": ltemporary = wdBelgianFrench
Case "BRA": ltemporary = wdBrazilianPortuguese
Case "BUL": ltemporary = wdBulgarian
Case "BYE": ltemporary = wdByelorussian
Case "CAT": ltemporary = wdCatalan
Case "CRO": ltemporary = wdCroatian
Case "CZE": ltemporary = wdCzech
Case "DAN": ltemporary = wdDanish
Case "DUT": ltemporary = wdDutch
Case "ENGA": ltemporary = wdEnglishAUS
Case "ENGC": ltemporary = wdEnglishCanadian
Case "ENGN": ltemporary = wdEnglishNewZealand
Case "ENGS": ltemporary = wdEnglishSouthAfrica
Case "ENGUK": ltemporary = wdEnglishUK
Case "ENGUS": ltemporary = wdEnglishUS
Case "EST": ltemporary = wdEstonian
Case "FAR": ltemporary = wdFarsi
Case "FIN": ltemporary = wdFinnish
Case "FRE": ltemporary = wdFrench
Case "FREC": ltemporary = wdFrenchCanadian
Case "GER": ltemporary = wdGerman
Case "GRE": ltemporary = wdGreek
Case "HEB": ltemporary = wdHebrew
Case "HUN": ltemporary = wdHungarian
Case "ITA": ltemporary = wdItalian
Case "ICE": ltemporary = wdIcelandic
Case "JAP": ltemporary = wdJapanese
Case "KOR": ltemporary = wdKorean
Case "LAT": ltemporary = wdLatvian
Case "MAC": ltemporary = wdMacedonian
Case "MAL": ltemporary = wdMalaysian
Case "MEX": ltemporary = wdMexicanSpanish
Case "NOWB": ltemporary = wdNorwegianBokmol
Case "NOWN": ltemporary = wdNorwegianNynorsk
Case "POL": ltemporary = wdPolish
Case "POR": ltemporary = wdPortuguese
Case "ROM": ltemporary = wdRomanian
Case "RUS": ltemporary = wdRussian
Case "SERC": ltemporary = wdSerbianCyrillic
Case "SERL": ltemporary = wdSerbianLatin
Case "SES": ltemporary = wdSesotho
Case "SIMC": ltemporary = wdSimplifiedChinese
Case "SLO": ltemporary = wdSlovak
Case "SLON": ltemporary = wdSlovenian
Case "SPA": ltemporary = wdSpanish
Case "SPAM": ltemporary = wdSpanishModernSort
Case "SWE": ltemporary = wdSwedish
Case "SWFR": ltemporary = wdSwissFrench
Case "SWGE": ltemporary = wdSwissGerman
Case "SWIT": ltemporary = wdSwissItalian
Case "TRAC": ltemporary = wdTraditionalChinese
Case "TSO": ltemporary = wdTsonga
Case "TSW": ltemporary = wdTswana
Case "TUR": ltemporary = wdTurkish
Case "UKR": ltemporary = wdUkrainian
Case "VEN": ltemporary = wdVenda
Case "XHO": ltemporary = wdXhosa
Case "ZUL": ltemporary = wdZulu
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_LanguageID", _
"Incorrect Language ID abbreviation : " & sLanguageIDKey)
End Select
zReturn_LanguageID = ltemporary
End Function

LineStyle

Returns the type of line style (in full) given an abbreviation.
Public Function zReturn_LineStyle(sLineStyleKey As String) As Long
Dim ltemporary As Long
Select Case sLineStyleKey
Case "NO": ltemporary = wdLineStyleNone
Case "SG": ltemporary = wdLineStyleSingle
Case "DT": ltemporary = wdLineStyleDot
Case "DSG": ltemporary = wdLineStyleDashSmallGap
Case "DLG": ltemporary = wdLineStyleDashLargeGap
Case "DD": ltemporary = wdLineStyleDashDot
Case "DDD": ltemporary = wdLineStyleDashDotDot
Case "DB": ltemporary = wdLineStyleDouble
Case "TP": ltemporary = wdLineStyleTriple
Case "TTHSG": ltemporary = wdLineStyleThinThickSmallGap
Case "THTSG": ltemporary = wdLineStyleThickThinSmallGap
Case "TTHTSG": ltemporary = wdLineStyleThinThickThinSmallGap
Case "TTHMG": ltemporary = wdLineStyleThinThickMedGap
Case "THTMG": ltemporary = wdLineStyleThickThinMedGap
Case "TTHTMG": ltemporary = wdLineStyleThinThickThinMedGap
Case "TTHLG": ltemporary = wdLineStyleThinThickLargeGap
Case "TTHTLG": ltemporary = wdLineStyleThinThickThinLargeGap
Case "SNWV": ltemporary = wdLineStyleSingleWavy
Case "DBWV": ltemporary = wdLineStyleDoubleWavy
Case "DDS": ltemporary = wdLineStyleDashDotStroked
Case "EM": ltemporary = wdLineStyleEmboss3D
Case "EG": ltemporary = wdLineStyleEngrave3D
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_LineStyle", _
"Incorrect Shading Colour abbreviation: " & sLineStyleKey)
End Select
zReturn_LineStyle = ltemporary
End Function

LineWidth

Returns the width of a line (in full) given an abbreviation.
Public Function zReturn_LineWidth(sLineWidthKey As String) As Long
Dim ltemporary As Long
Select Case sLineWidthKey
Case "025P": ltemporary = wdLineWidth025pt
Case "050P": ltemporary = wdLineWidth050pt
Case "075P": ltemporary = wdLineWidth075pt
Case "100P": ltemporary = wdLineWidth100pt
Case "150P": ltemporary = wdLineWidth150pt
Case "225P": ltemporary = wdLineWidth225pt
Case "300P": ltemporary = wdLineWidth300pt
Case "450P": ltemporary = wdLineWidth450pt
Case "600P": ltemporary = wdLineWidth600pt
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_LineWidth", _
"Incorrect Line Width abbreviation: " & sLineWidthKey)
End Select
zReturn_LineWidth = ltemporary
End Function

Margins_Set

Defines the margins for the active document.
Public Sub Margins_Set()
Const sPROCNAME As String = "Margins_Set"
On Error GoTo AnError


If gbDEBUG = False Then Exit Sub
AnError:
Call Error_Handle(msMODULENAME, sPROCNAME, 1,
"")
End Sub

PageNumberAlignment

Returns the Page Number alignment (in full) given an abbreviation.
Public Function zReturn_PageNumberAlignment(sPageNumberAlignmentKey As String) As String
Dim ltemporary As Long
Select Case sPageNumberAlignmentKey
Case "IN": ltemporary = wdAlignPageNumberInside
Case "OU": ltemporary = wdAlignPageNumberOutside
Case "LF": ltemporary = wdAlignPageNumberLeft
Case "RT": ltemporary = wdAlignPageNumberRight
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_PageNumberAlignment", _
"Incorrect Page Number Alignment abbreviation : " & sPageNumberAlignmentKey)
End Select
zReturn_PageNumberAlignment = ltemporary
End Function

ParaAlignment

Returns the paragraph alignment (in full) given an abbreviation.
Public Function zReturn_ParaAlignment(sParaAlignmentKey As String) As String
Dim ltemporary As Long
Select Case sParaAlignmentKey
Case "LF": ltemporary = wdAlignParagraphLeft
Case "CT": ltemporary = wdAlignParagraphCenter
Case "RT": ltemporary = wdAlignParagraphRight
Case "JS": ltemporary = wdAlignParagraphJustify
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_ParaAlignment", _
"Incorrect Paragraph Alignment abbreviation : " & sParaAlignmentKey)
End Select
zReturn_ParaAlignment = ltemporary
End Function

ParaLineSpacing

Returns the type of line spacing for a paragraph (in full) given an abbreviation.
Public Function zReturn_ParaLineSpacing(sLineSpacingKey As String) As Single
Dim sngtemporary As Single
Select Case sLineSpacingKey
Case "AL": sngtemporary = wdLineSpaceAtLeast
Case "EX": sngtemporary = wdLineSpaceExactly
Case "SN": sngtemporary = wdLineSpaceSingle
Case "15": sngtemporary = wdLineSpace1pt5
Case "ML": sngtemporary = wdLineSpaceMultiple
Case "DB": sngtemporary = wdLineSpaceDouble
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_ParaLineSpacing", _
"Incorrect Row Height abbreviation : " & sLineSpacingKey)
End Select
zReturn_ParaLineSpacing = sngtemporary
End Function

RowHeight

Returns the type of row height (in full) given an abbreviation.
Public Function zReturn_RowHeight(sHeightKey As String) As Long
Dim ltemporary As Long
Select Case sHeightKey
Case "AL": ltemporary = wdRowHeightAtLeast
Case "AU": ltemporary = wdRowHeightAuto
Case "EX": ltemporary = wdRowHeightExactly
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_RowHeight", _
"Incorrect RowHeight abbreviation: " & sHeightKey)
End Select
zReturn_RowHeight = ltemporary
End Function

SelectionWhere

Returns the location of the current selection.
Public Function zReturn_SelectionWhere(selSelection As Selection) As String
Dim stemporary As String
Select Case selSelection.StoryType
Case wdEndnotesStory: stemporary = "EndNotes"
Case wdEvenPagesFooterStory: stemporary = "Header/Footer"
Case wdEvenPagesHeaderStory: stemporary = "Header/Footer"
Case wdFirstPageFooterStory: stemporary = "Header/Footer"
Case wdFirstPageHeaderStory: stemporary = "Header/Footer"
Case wdFootnotesStory: stemporary = "FootNotes"
Case wdMainTextStory: stemporary = "MainText"
Case wdPrimaryFooterStory: stemporary = "Header/Footer"
Case wdPrimaryHeaderStory: stemporary = "Header/Footer"
Case wdTextFrameStory: stemporary = "Textbox/Frame"
End Select
If stemporary = "MainText" Then
If selSelection.Information(wdWithInTable) = True Then _
stemporary = "InTable"
If selSelection.Information(wdFrameIsSelected) = True Then _
stemporary = "FrameSelected"
If selSelection.Frames.count = 1 Then _
stemporary = "InFrame"
End If
zReturn_SelectionWhere = stemporary
End Function

ShadingColour

Returns the shading colour (in full) given an abbreviation.
Public Function zReturn_ShadingColour(sColourKey As String) As Long
Dim ltemporary As Long
Select Case sColourKey
Case "AU": ltemporary = wdAuto
Case "BK": ltemporary = wdBlack
Case "BL": ltemporary = wdBlue
Case "BG": ltemporary = wdBrightGreen
Case "DB": ltemporary = wdDarkBlue
Case "DR": ltemporary = wdDarkRed
Case "DY": ltemporary = wdDarkYellow
Case "G25": ltemporary = wdGray25
Case "G50": ltemporary = wdGray50
Case "GR": ltemporary = wdGreen
Case "NH": ltemporary = wdNoHighlight
Case "PK": ltemporary = wdPink
Case "RD": ltemporary = wdRed
Case "TL": ltemporary = wdTeal
Case "TQ": ltemporary = wdTurquoise
Case "VO": ltemporary = wdViolet
Case "WH": ltemporary = wdWhite
Case "YL": ltemporary = wdYellow
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_FontName", _
"Incorrect Shading Colour abbreviation: " & sColourKey)
End Select
zReturn_ShadingColour = ltemporary
End Function

ShadingTexture

Returns the type of shading texture (in full) given an abbreviation.
Public Function zReturn_ShadingTexture(sTextureKey As String) As Long
Dim ltemporary As Long
Select Case sTextureKey
' Case "AU": ltemporary = wdtextureauto
Case "NO": ltemporary = wdTextureNone
Case "SL": ltemporary = wdTextureSolid
Case "2P5": ltemporary = wdTexture2Pt5Percent
Case "5P": ltemporary = wdTexture5Percent
Case "7P5": ltemporary = wdTexture7Pt5Percent
Case "10P": ltemporary = wdTexture10Percent
Case "12P5": ltemporary = wdTexture12Pt5Percent
Case "15P": ltemporary = wdTexture15Percent
Case "17P5": ltemporary = wdTexture17Pt5Percent
Case "20P": ltemporary = wdTexture20Percent
Case "22P5": ltemporary = wdTexture22Pt5Percent
Case "25P": ltemporary = wdTexture25Percent
Case "27P5": ltemporary = wdTexture27Pt5Percent
Case "30P": ltemporary = wdTexture30Percent
Case "32P5": ltemporary = wdTexture32Pt5Percent
Case "35P": ltemporary = wdTexture35Percent
Case "37P5": ltemporary = wdTexture37Pt5Percent
Case "40P": ltemporary = wdTexture40Percent
Case "42P5": ltemporary = wdTexture42Pt5Percent
Case "45P": ltemporary = wdTexture45Percent
Case "47P5": ltemporary = wdTexture47Pt5Percent
Case "50P": ltemporary = wdTexture50Percent
Case "52P5": ltemporary = wdTexture52Pt5Percent
Case "55P": ltemporary = wdTexture55Percent
Case "57P5": ltemporary = wdTexture57Pt5Percent
Case "60P": ltemporary = wdTexture60Percent
Case "62P5": ltemporary = wdTexture62Pt5Percent
Case "65P": ltemporary = wdTexture65Percent
Case "67P5": ltemporary = wdTexture67Pt5Percent
Case "70P": ltemporary = wdTexture70Percent
Case "72P5": ltemporary = wdTexture72Pt5Percent
Case "75P": ltemporary = wdTexture75Percent
Case "77P5": ltemporary = wdTexture77Pt5Percent
Case "80P": ltemporary = wdTexture80Percent
Case "82P5": ltemporary = wdTexture82Pt5Percent
Case "85P": ltemporary = wdTexture85Percent
Case "87P5": ltemporary = wdTexture87Pt5Percent
Case "90P": ltemporary = wdTexture90Percent
Case "92P5": ltemporary = wdTexture92Pt5Percent
Case "95P": ltemporary = wdTexture95Percent
Case "97P5": ltemporary = wdTexture97Pt5Percent
Case "DRH": ltemporary = wdTextureDarkHorizontal
Case "DRV": ltemporary = wdTextureDarkVertical
Case "DRC": ltemporary = wdTextureDarkCross
Case "DDC": ltemporary = wdTextureDarkDiagonalCross
Case "DDD": ltemporary = wdTextureDarkDiagonalDown
Case "DDU": ltemporary = wdTextureDarkDiagonalUp
Case "HR": ltemporary = wdTextureHorizontal
Case "VR": ltemporary = wdTextureVertical
Case "CR": ltemporary = wdTextureCross
Case "DIC": ltemporary = wdTextureDiagonalCross
Case "DID": ltemporary = wdTextureDiagonalDown
Case "DIU": ltemporary = wdTextureDiagonalUp
Case "SLD": ltemporary = wdTextureSolid
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_FontName", _
"Incorrect Shading Texture abbreviation : " & sTextureKey)
End Select
zReturn_ShadingTexture = ltemporary
End Function

TabAlignment

Returns the type of tab aligment that applies to a paragraph (in full) given an abbreviation.
Public Function zReturn_TabAlignment(sTabAlignmentKey As String) As String
Dim ltemporary As Long
Select Case sTabAlignmentKey
Case "BR": ltemporary = wdAlignTabBar
Case "DC": ltemporary = wdAlignTabDecimal
Case "LF": ltemporary = wdAlignTabLeft
Case "LS": ltemporary = wdAlignTabList
Case "RT": ltemporary = wdAlignTabRight
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_TabAlignment", _
"Incorrect Tab Alignment abbreviation : " & sTabAlignmentKey)
End Select
zReturn_TabAlignment = ltemporary
End Function

TabLeader

Returns the type of tab leader that applies to a paragraph (in full) given an abbreviation.
Public Function zReturn_TabLeader(sTabLeaderKey As String) As Long
Dim ltemporary As Long
Select Case sTabLeaderKey
Case "DS": ltemporary = wdTabLeaderDashes
Case "DT": ltemporary = wdTabLeaderDots
Case "HV": ltemporary = wdTabLeaderHeavy
Case "LL": ltemporary = wdTabLeaderLines
Case "LS": ltemporary = wdTabLeaderSpaces
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_Animation", _
"Incorrect Tab Alignment abbreviation : " & sTabLeaderKey)
End Select
zReturn_TabLeader = ltemporary
End Function

Underline

Returns the type of underlining (in full) given an abbreviation.
Public Function zReturn_Underline(sUnderLineKey As String) As Long
Dim ltemporary As Long
Select Case sUnderLineKey
Case "NO": ltemporary = wdUnderlineNone
Case "DS": ltemporary = wdUnderlineDash
Case "DD": ltemporary = wdUnderlineDotDash
Case "DDD": ltemporary = wdUnderlineDotDotDash
Case "TH": ltemporary = wdUnderlineThick
Case "DT": ltemporary = wdUnderlineDotted
Case "DB": ltemporary = wdUnderlineDouble
Case "SN": ltemporary = wdUnderlineSingle
Case "WD": ltemporary = wdUnderlineWords
Case "WV": ltemporary = wdUnderlineWavy
Case Else
' Call MsgBox(
Call Frm_Inform("zReturn_Underline", _
"Incorrect Row Height abbreviation : " & sUnderLineKey)
End Select
zReturn_Underline = ltemporary
End Function

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top