Cobra17
Mechanical
- Jun 18, 2020
- 165
is there a way to add a "description" to a section in VBA so that I can reference it when coding? so if I insert a new section I don't have to adjust all my section call outs
currently I'm creating a section from Access VBA to Word like so:
I'd like to be able to create the section and reference it like "wd.ActiveDocument.Sections("Header").Range.Font.Size = 11" or something.. I currently have 20 sections and its a pain to go back and update all of them.
currently I'm creating a section from Access VBA to Word like so:
Code:
wd.Selection.InsertAfter Text:=vbTab & "TAG #" & vbTab & vbTab & "QTY" & vbTab & "DESCRIPTION" & vbCr
wd.ActiveDocument.Sections(1).Range.Font.Size = 11
wd.ActiveDocument.Sections(1).Range.Font.Bold = False
wd.ActiveDocument.Sections(1).Range.Font.AllCaps = True
wd.ActiveDocument.Sections(1).Range.Font.Underline = False
wd.ActiveDocument.Sections(1).Range.Font.Italic = False
wd.Selection.Collapse wdCollapseEnd
wd.Selection.InsertBreak Type:=wdSectionBreakContinuous
wd.Selection.TypeParagraph
I'd like to be able to create the section and reference it like "wd.ActiveDocument.Sections("Header").Range.Font.Size = 11" or something.. I currently have 20 sections and its a pain to go back and update all of them.