F
Flicc
Hello,
I just started an internship, and for my internship i'm making word
templates, with some basic VB code. It should work in the following
way: employees when opening the file get an wizzard with fields to
fill in and the rest is drawn from a database. Everything works fine,
except for when i want the output of a wizzard to start on a new
line.
The code for the wizzard:
Selection.Find.ClearFormatting
With Selection.Find
.Text = _
"uur per week, de werktijden zijn van"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:= _
"FILLIN ""werktijden"" ", _
PreserveFormatting:=True
--------------------
The count:=2 is gives 2 spaces behind the word i searched for, however
i dont want to just fill in enough spaces till we start on a new line,
since this should ofcourse be possible with vb code. I'm really a noob
in this area, so pls explain on a for dummies level
Thanks in advance!
I just started an internship, and for my internship i'm making word
templates, with some basic VB code. It should work in the following
way: employees when opening the file get an wizzard with fields to
fill in and the rest is drawn from a database. Everything works fine,
except for when i want the output of a wizzard to start on a new
line.
The code for the wizzard:
Selection.Find.ClearFormatting
With Selection.Find
.Text = _
"uur per week, de werktijden zijn van"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:= _
"FILLIN ""werktijden"" ", _
PreserveFormatting:=True
--------------------
The count:=2 is gives 2 spaces behind the word i searched for, however
i dont want to just fill in enough spaces till we start on a new line,
since this should ofcourse be possible with vb code. I'm really a noob
in this area, so pls explain on a for dummies level
Thanks in advance!