Results 1 to 2 of 2
2013-08-12, 15:38 #1
- Join Date
- Aug 2013
- Thanked 0 Times in 0 Posts
VBA word: how to design subroutin
I have a repetitive task of printing 10 lines.
Each line includes text, drop down list, and optional another drop down list.
I wrote the following code per line, that does the job (at least I think so):
Selection.TypeText Text:="The Vital Capacity is:" & vbTab Dim objcc1 As ContentControl Set objcc1 = Selection.Range.ContentControls.Add(wdContentControlDropdownList) objcc1.DropdownListEntries.Add "Normal" objcc1.DropdownListEntries.Add "Low Normal" objcc1.DropdownListEntries.Add "Increased" objcc1.DropdownListEntries.Add "Decreased" Selection.MoveDown Unit:=wdLine, Count:=1 Selection.TypeParagraph
i was repeating to make a subroutine, something like:
Sub PrintLine(mytext As Integer, obj As ContentControl) End Sub
Any idea how can I just declare and assign the drop down outside the SUB, and only printing it inside the SUB?
And the first thing I saw is that if
2013-08-12, 16:02 #2
- Join Date
- Jan 2001
- Sun Prairie, Wisconsin, Wisconsin, USA
- Thanked 119 Times in 116 Posts
You need to be in a different forum. This one is about using Word Processing programs (end user) not development. See: The VBA forum.Charles Kyle Kenyon