T
ted medin
Ok i created a template which is a single line like this:
word0 word1 word2
word3 word4
Inserted a bookmark for each word(x) which spanned almost to the next
word(x+1)
the problem is with the following code the spacing between the bookmarks
changes :-(.
I was hoping to insert columns with each succeeding line falling directly
under the previous.
So where am i going wrong? TIA
--------------- part of the
code ---------------------------------------------
While Not rstProj.EOF
intTem = rstProj![project region]
If intTem <> intProjro Then
intProjro = intTem ' until it changes
Selection.InsertFile FileName:="c:\program files\microsoft
office\templates\newsletterrpl.dot", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
With ActiveDocument.Bookmarks("region")
intLenRegion = .End - .Start
End With
Selection.GoTo What:=wdGoToBookmark, Name:="region"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.TypeText Text:=rstProj![project region]
Selection.TypeParagraph
End If
rstMem.Seek "=", rstProj![project number]
If Not (rstMem.NoMatch) Then
' We have a match
Selection.InsertFile FileName:="c:\program files\microsoft
office\templates\newsletterpl.dot", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
With ActiveDocument.Bookmarks("project")
intLenProject = .End - .Start
End With
Selection.GoTo What:=wdGoToBookmark, Name:="project"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.TypeText Text:=Left(rstProj![Project] &
Space(intLenProject), intLenProject - 1)
With ActiveDocument.Bookmarks("activity_name")
intLenActivityname = .End - .Start
End With
Selection.GoTo What:=wdGoToBookmark, Name:="activity_name"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.TypeText Text:=Left(rstMem![activity name] &
Space(intLenActivityname), intLenActivityname - 1)
With ActiveDocument.Bookmarks("city")
intLenCity = .End - .Start
End With
Selection.GoTo What:=wdGoToBookmark, Name:="city"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.TypeText Text:=Left(rstMem![city] & Space(intLenCity),
intLenCity - 1)
With ActiveDocument.Bookmarks("state")
intLenState = .End - .Start
End With
Selection.GoTo What:=wdGoToBookmark, Name:="state"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.TypeText Text:=Left(rstMem![state] & Space(intLenState),
intLenState - 1)
Selection.TypeParagraph
Else
MsgBox ("Unable to find site" & intTem)
End If
rstProj.MoveNext
Wend
------------end of code --------------------------------------------
word0 word1 word2
word3 word4
Inserted a bookmark for each word(x) which spanned almost to the next
word(x+1)
the problem is with the following code the spacing between the bookmarks
changes :-(.
I was hoping to insert columns with each succeeding line falling directly
under the previous.
So where am i going wrong? TIA
--------------- part of the
code ---------------------------------------------
While Not rstProj.EOF
intTem = rstProj![project region]
If intTem <> intProjro Then
intProjro = intTem ' until it changes
Selection.InsertFile FileName:="c:\program files\microsoft
office\templates\newsletterrpl.dot", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
With ActiveDocument.Bookmarks("region")
intLenRegion = .End - .Start
End With
Selection.GoTo What:=wdGoToBookmark, Name:="region"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.TypeText Text:=rstProj![project region]
Selection.TypeParagraph
End If
rstMem.Seek "=", rstProj![project number]
If Not (rstMem.NoMatch) Then
' We have a match
Selection.InsertFile FileName:="c:\program files\microsoft
office\templates\newsletterpl.dot", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
With ActiveDocument.Bookmarks("project")
intLenProject = .End - .Start
End With
Selection.GoTo What:=wdGoToBookmark, Name:="project"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.TypeText Text:=Left(rstProj![Project] &
Space(intLenProject), intLenProject - 1)
With ActiveDocument.Bookmarks("activity_name")
intLenActivityname = .End - .Start
End With
Selection.GoTo What:=wdGoToBookmark, Name:="activity_name"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.TypeText Text:=Left(rstMem![activity name] &
Space(intLenActivityname), intLenActivityname - 1)
With ActiveDocument.Bookmarks("city")
intLenCity = .End - .Start
End With
Selection.GoTo What:=wdGoToBookmark, Name:="city"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.TypeText Text:=Left(rstMem![city] & Space(intLenCity),
intLenCity - 1)
With ActiveDocument.Bookmarks("state")
intLenState = .End - .Start
End With
Selection.GoTo What:=wdGoToBookmark, Name:="state"
Selection.Find.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.TypeText Text:=Left(rstMem![state] & Space(intLenState),
intLenState - 1)
Selection.TypeParagraph
Else
MsgBox ("Unable to find site" & intTem)
End If
rstProj.MoveNext
Wend
------------end of code --------------------------------------------