Tab doesnt work 
Author Message
 Tab doesnt work

Hi,

Here is newbie question .............

I am forcing tab by using vbTab, but still it doesnt tab in Word Document
using VBA. Here is the code.

Dim mobjRange As Object
Set mobjRange = ActiveDocument.Bookmarks.Item("Subj").Range

 mobjRange.Collapse (wdCollapseEnd)
 mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
 mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
 ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1), _
ContinuePreviousList:=True

Many Thanks,
Krish



Fri, 04 Mar 2005 21:33:56 GMT  
 Tab doesnt work
Hi Krish,

If your mobjRange is an insertion point, then the routine doesn't work
because you apply the number list to the range.

If you want the number list and more tabs after that, then try the
following:

Dim mobjRange As Object
Set mobjRange = ActiveDocument.Bookmarks.Item("subj").Range
mobjRange.Collapse (wdCollapseEnd)
mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
    ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(2), _
    ContinuePreviousList:=True
mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf

HTH


Quote:
> Hi,

> Here is newbie question .............

> I am forcing tab by using vbTab, but still it doesnt tab in Word Document
> using VBA. Here is the code.

> Dim mobjRange As Object
> Set mobjRange = ActiveDocument.Bookmarks.Item("Subj").Range

>  mobjRange.Collapse (wdCollapseEnd)
>  mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
>  mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
>  ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1), _
> ContinuePreviousList:=True

> Many Thanks,
> Krish



Fri, 04 Mar 2005 22:11:21 GMT  
 Tab doesnt work
Hi Dave,

I want tabs & then number list. I tried mobjRange.InsertAfter vbTab & vbTab
& Trim(SOMETEXT) & vbCrLf and then numbered bullet . It didnt work.  It
typed the text and in the next line it shows numbered bullet.

Any idea.

Thanks,
Krish


Quote:
> Hi Krish,

> If your mobjRange is an insertion point, then the routine doesn't work
> because you apply the number list to the range.

> If you want the number list and more tabs after that, then try the
> following:

> Dim mobjRange As Object
> Set mobjRange = ActiveDocument.Bookmarks.Item("subj").Range
> mobjRange.Collapse (wdCollapseEnd)
> mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
>     ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(2), _
>     ContinuePreviousList:=True
> mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf

> HTH



> > Hi,

> > Here is newbie question .............

> > I am forcing tab by using vbTab, but still it doesnt tab in Word
Document
> > using VBA. Here is the code.

> > Dim mobjRange As Object
> > Set mobjRange = ActiveDocument.Bookmarks.Item("Subj").Range

> >  mobjRange.Collapse (wdCollapseEnd)
> >  mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
> >  mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> >  ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1), _
> > ContinuePreviousList:=True

> > Many Thanks,
> > Krish



Fri, 04 Mar 2005 22:21:43 GMT  
 Tab doesnt work
Hi Krish,

My apologies, should have seen that you're applying the numbered list the
range. The following should take care of it (collapse the range a second
time):

mobjRange.Collapse (wdCollapseEnd)
mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
mobjRange.Collapse (wdCollapseEnd)
mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
    ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1), _
    ContinuePreviousList:=True

HTH


Quote:
> Hi Dave,

> I want tabs & then number list. I tried mobjRange.InsertAfter vbTab &
vbTab
> & Trim(SOMETEXT) & vbCrLf and then numbered bullet . It didnt work.  It
> typed the text and in the next line it shows numbered bullet.

> Any idea.

> Thanks,
> Krish



> > Hi Krish,

> > If your mobjRange is an insertion point, then the routine doesn't work
> > because you apply the number list to the range.

> > If you want the number list and more tabs after that, then try the
> > following:

> > Dim mobjRange As Object
> > Set mobjRange = ActiveDocument.Bookmarks.Item("subj").Range
> > mobjRange.Collapse (wdCollapseEnd)
> > mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> >     ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(2), _
> >     ContinuePreviousList:=True
> > mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf

> > HTH



> > > Hi,

> > > Here is newbie question .............

> > > I am forcing tab by using vbTab, but still it doesnt tab in Word
> Document
> > > using VBA. Here is the code.

> > > Dim mobjRange As Object
> > > Set mobjRange = ActiveDocument.Bookmarks.Item("Subj").Range

> > >  mobjRange.Collapse (wdCollapseEnd)
> > >  mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
> > >  mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> > >  ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1), _
> > > ContinuePreviousList:=True

> > > Many Thanks,
> > > Krish



Fri, 04 Mar 2005 22:38:21 GMT  
 Tab doesnt work
Hi Dave,

Even this didnt help. It printed the text following the number list in next
line with tab order perfectly.

Iam not sure where iam going wrong.

Let me know if you have any other ideas.

Many thanks,
Krish


Quote:
> Hi Krish,

> My apologies, should have seen that you're applying the numbered list the
> range. The following should take care of it (collapse the range a second
> time):

> mobjRange.Collapse (wdCollapseEnd)
> mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
> mobjRange.Collapse (wdCollapseEnd)
> mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
>     ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1), _
>     ContinuePreviousList:=True

> HTH



> > Hi Dave,

> > I want tabs & then number list. I tried mobjRange.InsertAfter vbTab &
> vbTab
> > & Trim(SOMETEXT) & vbCrLf and then numbered bullet . It didnt work.  It
> > typed the text and in the next line it shows numbered bullet.

> > Any idea.

> > Thanks,
> > Krish



> > > Hi Krish,

> > > If your mobjRange is an insertion point, then the routine doesn't work
> > > because you apply the number list to the range.

> > > If you want the number list and more tabs after that, then try the
> > > following:

> > > Dim mobjRange As Object
> > > Set mobjRange = ActiveDocument.Bookmarks.Item("subj").Range
> > > mobjRange.Collapse (wdCollapseEnd)
> > > mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> > >     ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(2), _
> > >     ContinuePreviousList:=True
> > > mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf

> > > HTH



> > > > Hi,

> > > > Here is newbie question .............

> > > > I am forcing tab by using vbTab, but still it doesnt tab in Word
> > Document
> > > > using VBA. Here is the code.

> > > > Dim mobjRange As Object
> > > > Set mobjRange = ActiveDocument.Bookmarks.Item("Subj").Range

> > > >  mobjRange.Collapse (wdCollapseEnd)
> > > >  mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
> > > >  mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> > > >  ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1), _
> > > > ContinuePreviousList:=True

> > > > Many Thanks,
> > > > Krish



Fri, 04 Mar 2005 23:14:43 GMT  
 Tab doesnt work
Hi Krish

'*****Document BEFORE macro*****'
text [subj bookmark] [paragraph]

'*****Document AFTER macro*****'
text [tab][tab]SOMETEXT[paragraph]
[numbered item][paragraph]

Which is exactly what the macro tells it to do. Can you show me what the
document looks like first and then what you want to look like after? Your
original query said that the macro didn't tab (which I took to mean the
macro didn't insert the tab marks in the document). I answered that you
"overwrite" those tabs when you apply the numbered list to the range when
the bookmark is an insertion point. If you want the following:

'*****Document BEFORE macro*****'
[subj bookmark with no text] [paragraph]

'*****Document AFTER macro*****'
[numbered item][tab][tab]SOMETEXT[paragraph]
[paragraph]

then you'll have to redefine your numbered list style (or the indentation of
the paragraph format), I suspect.

HTH


Quote:
> Hi Dave,

> Even this didnt help. It printed the text following the number list in
next
> line with tab order perfectly.

> Iam not sure where iam going wrong.

> Let me know if you have any other ideas.

> Many thanks,
> Krish



> > Hi Krish,

> > My apologies, should have seen that you're applying the numbered list
the
> > range. The following should take care of it (collapse the range a second
> > time):

> > mobjRange.Collapse (wdCollapseEnd)
> > mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
> > mobjRange.Collapse (wdCollapseEnd)
> > mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> >     ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1), _
> >     ContinuePreviousList:=True

> > HTH



> > > Hi Dave,

> > > I want tabs & then number list. I tried mobjRange.InsertAfter vbTab &
> > vbTab
> > > & Trim(SOMETEXT) & vbCrLf and then numbered bullet . It didnt work.
It
> > > typed the text and in the next line it shows numbered bullet.

> > > Any idea.

> > > Thanks,
> > > Krish



> > > > Hi Krish,

> > > > If your mobjRange is an insertion point, then the routine doesn't
work
> > > > because you apply the number list to the range.

> > > > If you want the number list and more tabs after that, then try the
> > > > following:

> > > > Dim mobjRange As Object
> > > > Set mobjRange = ActiveDocument.Bookmarks.Item("subj").Range
> > > > mobjRange.Collapse (wdCollapseEnd)
> > > > mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> > > >     ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(2), _
> > > >     ContinuePreviousList:=True
> > > > mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf

> > > > HTH



> > > > > Hi,

> > > > > Here is newbie question .............

> > > > > I am forcing tab by using vbTab, but still it doesnt tab in Word
> > > Document
> > > > > using VBA. Here is the code.

> > > > > Dim mobjRange As Object
> > > > > Set mobjRange = ActiveDocument.Bookmarks.Item("Subj").Range

> > > > >  mobjRange.Collapse (wdCollapseEnd)
> > > > >  mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
> > > > >  mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> > > > >  ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1), _
> > > > > ContinuePreviousList:=True

> > > > > Many Thanks,
> > > > > Krish



Fri, 04 Mar 2005 23:46:14 GMT  
 Tab doesnt work
Hi Dave,

Pardon me for being so dumb...since i have just started my VBA just a week
back.

Anyway ... i guess from your reply that indentation is the problem.

My requirement goes like this..

'******Document BEFORE *******

'***** Document AFTER *********

Do
[Bullet] [tab] [some text generated from database]          - FIRST
PARAGRAPH DISPLAY
[Bullet] [tab] [some text generated from database]
Loop till end of record

Do
[tab] [numbered bullet] [some text generated from database]   - SECOND
PARAGRAPH DISPLAY   (here i have problem in indentation one level or tabing
one)
[tab] [numbered bullet] [some text generated from database]
Loop till end of record

Do
[tab] [tab] [Bullet] [some text generated from database]    - THIRD
PARAGRAPH DISPLAY (here also i have problem in indentation two levels or
tabing two )
[tab] [tab] [Bullet] [some text generated from database]
Loop till end of record

'*****************************
Can you tell me where iam going wrong. Is that indentation i have to set in
my word document for the numbering. If so, how will i do for the bullets
because first paragraph doesnt require any indent. In third paragraph the
bullets require two indentation.

Appreciate your patience .

Krish


Quote:
> Hi Krish

> '*****Document BEFORE macro*****'
> text [subj bookmark] [paragraph]

> '*****Document AFTER macro*****'
> text [tab][tab]SOMETEXT[paragraph]
> [numbered item][paragraph]

> Which is exactly what the macro tells it to do. Can you show me what the
> document looks like first and then what you want to look like after? Your
> original query said that the macro didn't tab (which I took to mean the
> macro didn't insert the tab marks in the document). I answered that you
> "overwrite" those tabs when you apply the numbered list to the range when
> the bookmark is an insertion point. If you want the following:

> '*****Document BEFORE macro*****'
> [subj bookmark with no text] [paragraph]

> '*****Document AFTER macro*****'
> [numbered item][tab][tab]SOMETEXT[paragraph]
> [paragraph]

> then you'll have to redefine your numbered list style (or the indentation
of
> the paragraph format), I suspect.

> HTH



> > Hi Dave,

> > Even this didnt help. It printed the text following the number list in
> next
> > line with tab order perfectly.

> > Iam not sure where iam going wrong.

> > Let me know if you have any other ideas.

> > Many thanks,
> > Krish



> > > Hi Krish,

> > > My apologies, should have seen that you're applying the numbered list
> the
> > > range. The following should take care of it (collapse the range a
second
> > > time):

> > > mobjRange.Collapse (wdCollapseEnd)
> > > mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
> > > mobjRange.Collapse (wdCollapseEnd)
> > > mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> > >     ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1), _
> > >     ContinuePreviousList:=True

> > > HTH



> > > > Hi Dave,

> > > > I want tabs & then number list. I tried mobjRange.InsertAfter vbTab
&
> > > vbTab
> > > > & Trim(SOMETEXT) & vbCrLf and then numbered bullet . It didnt work.
> It
> > > > typed the text and in the next line it shows numbered bullet.

> > > > Any idea.

> > > > Thanks,
> > > > Krish



> > > > > Hi Krish,

> > > > > If your mobjRange is an insertion point, then the routine doesn't
> work
> > > > > because you apply the number list to the range.

> > > > > If you want the number list and more tabs after that, then try the
> > > > > following:

> > > > > Dim mobjRange As Object
> > > > > Set mobjRange = ActiveDocument.Bookmarks.Item("subj").Range
> > > > > mobjRange.Collapse (wdCollapseEnd)
> > > > > mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> > > > >     ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(2),
_
> > > > >     ContinuePreviousList:=True
> > > > > mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf

> > > > > HTH



> > > > > > Hi,

> > > > > > Here is newbie question .............

> > > > > > I am forcing tab by using vbTab, but still it doesnt tab in Word
> > > > Document
> > > > > > using VBA. Here is the code.

> > > > > > Dim mobjRange As Object
> > > > > > Set mobjRange = ActiveDocument.Bookmarks.Item("Subj").Range

> > > > > >  mobjRange.Collapse (wdCollapseEnd)
> > > > > >  mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
> > > > > >  mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> > > > > >  ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1),
_
> > > > > > ContinuePreviousList:=True

> > > > > > Many Thanks,
> > > > > > Krish



Sat, 05 Mar 2005 01:08:01 GMT  
 Tab doesnt work
Hi Krish,

I think I understand better what you're trying to do. You want a list and
sublists. Therefore, I would use something like the following:

First Loop
Set Range
ListGalleries(wdNumberGallery).ListTemplates(2).ListLevels(1).NumberPosition
= InchesToPoints(0)
ListGalleries(wdNumberGallery).ListTemplates(2).ListLevels(1).TabPosition =
InchesToPoints(0.5)
Insert text

Second Loop
Set Range
ListGalleries(wdNumberGallery).ListTemplates(2).ListLevels(2).NumberPosition
= InchesToPoints(0.5)
ListGalleries(wdNumberGallery).ListTemplates(2).ListLevels(2).TabPosition =
InchesToPoints(1)
Insert text

Third Loop
Set Range
ListGalleries(wdNumberGallery).ListTemplates(2).ListLevels(3).NumberPosition
= InchesToPoints(1)
ListGalleries(wdNumberGallery).ListTemplates(2).ListLevels(3).TabPosition =
InchesToPoints(1.5)
Insert text

You might need to change the index number of the ListTemplates in this
example. You might also want to change the NumberStyle and whatnot, but I
think you get the point now. BTW, if you've only been working with VBA for a
week, then you're doing very, very well.

HTH


Quote:
> Hi Dave,

> Pardon me for being so dumb...since i have just started my VBA just a week
> back.

> Anyway ... i guess from your reply that indentation is the problem.

> My requirement goes like this..

> '******Document BEFORE *******

> '***** Document AFTER *********

> Do
> [Bullet] [tab] [some text generated from database]          - FIRST
> PARAGRAPH DISPLAY
> [Bullet] [tab] [some text generated from database]
> Loop till end of record

> Do
> [tab] [numbered bullet] [some text generated from database]   - SECOND
> PARAGRAPH DISPLAY   (here i have problem in indentation one level or
tabing
> one)
> [tab] [numbered bullet] [some text generated from database]
> Loop till end of record

> Do
> [tab] [tab] [Bullet] [some text generated from database]    - THIRD
> PARAGRAPH DISPLAY (here also i have problem in indentation two levels or
> tabing two )
> [tab] [tab] [Bullet] [some text generated from database]
> Loop till end of record

> '*****************************
> Can you tell me where iam going wrong. Is that indentation i have to set
in
> my word document for the numbering. If so, how will i do for the bullets
> because first paragraph doesnt require any indent. In third paragraph the
> bullets require two indentation.

> Appreciate your patience .

> Krish



> > Hi Krish

> > '*****Document BEFORE macro*****'
> > text [subj bookmark] [paragraph]

> > '*****Document AFTER macro*****'
> > text [tab][tab]SOMETEXT[paragraph]
> > [numbered item][paragraph]

> > Which is exactly what the macro tells it to do. Can you show me what the
> > document looks like first and then what you want to look like after?
Your
> > original query said that the macro didn't tab (which I took to mean the
> > macro didn't insert the tab marks in the document). I answered that you
> > "overwrite" those tabs when you apply the numbered list to the range
when
> > the bookmark is an insertion point. If you want the following:

> > '*****Document BEFORE macro*****'
> > [subj bookmark with no text] [paragraph]

> > '*****Document AFTER macro*****'
> > [numbered item][tab][tab]SOMETEXT[paragraph]
> > [paragraph]

> > then you'll have to redefine your numbered list style (or the
indentation
> of
> > the paragraph format), I suspect.

> > HTH



> > > Hi Dave,

> > > Even this didnt help. It printed the text following the number list in
> > next
> > > line with tab order perfectly.

> > > Iam not sure where iam going wrong.

> > > Let me know if you have any other ideas.

> > > Many thanks,
> > > Krish



> > > > Hi Krish,

> > > > My apologies, should have seen that you're applying the numbered
list
> > the
> > > > range. The following should take care of it (collapse the range a
> second
> > > > time):

> > > > mobjRange.Collapse (wdCollapseEnd)
> > > > mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
> > > > mobjRange.Collapse (wdCollapseEnd)
> > > > mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> > > >     ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1), _
> > > >     ContinuePreviousList:=True

> > > > HTH



> > > > > Hi Dave,

> > > > > I want tabs & then number list. I tried mobjRange.InsertAfter
vbTab
> &
> > > > vbTab
> > > > > & Trim(SOMETEXT) & vbCrLf and then numbered bullet . It didnt
work.
> > It
> > > > > typed the text and in the next line it shows numbered bullet.

> > > > > Any idea.

> > > > > Thanks,
> > > > > Krish



> > > > > > Hi Krish,

> > > > > > If your mobjRange is an insertion point, then the routine
doesn't
> > work
> > > > > > because you apply the number list to the range.

> > > > > > If you want the number list and more tabs after that, then try
the
> > > > > > following:

> > > > > > Dim mobjRange As Object
> > > > > > Set mobjRange = ActiveDocument.Bookmarks.Item("subj").Range
> > > > > > mobjRange.Collapse (wdCollapseEnd)
> > > > > > mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _

ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(2),

- Show quoted text -

Quote:
> _
> > > > > >     ContinuePreviousList:=True
> > > > > > mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf

> > > > > > HTH



> > > > > > > Hi,

> > > > > > > Here is newbie question .............

> > > > > > > I am forcing tab by using vbTab, but still it doesnt tab in
Word
> > > > > Document
> > > > > > > using VBA. Here is the code.

> > > > > > > Dim mobjRange As Object
> > > > > > > Set mobjRange = ActiveDocument.Bookmarks.Item("Subj").Range

> > > > > > >  mobjRange.Collapse (wdCollapseEnd)
> > > > > > >  mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
> > > > > > >  mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _

ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1),

- Show quoted text -

Quote:
> _
> > > > > > > ContinuePreviousList:=True

> > > > > > > Many Thanks,
> > > > > > > Krish



Sat, 05 Mar 2005 02:26:03 GMT  
 Tab doesnt work
Thank You Dave, it helped a lot.  Iam getting better and better in VBA
programming just because of you & other VBA guru's help only.

Many Thanks,
Krish


Quote:
> Hi Krish,

> I think I understand better what you're trying to do. You want a list and
> sublists. Therefore, I would use something like the following:

> First Loop
> Set Range

ListGalleries(wdNumberGallery).ListTemplates(2).ListLevels(1).NumberPosition
Quote:
> = InchesToPoints(0)
> ListGalleries(wdNumberGallery).ListTemplates(2).ListLevels(1).TabPosition
=
> InchesToPoints(0.5)
> Insert text

> Second Loop
> Set Range

ListGalleries(wdNumberGallery).ListTemplates(2).ListLevels(2).NumberPosition
Quote:
> = InchesToPoints(0.5)
> ListGalleries(wdNumberGallery).ListTemplates(2).ListLevels(2).TabPosition
=
> InchesToPoints(1)
> Insert text

> Third Loop
> Set Range

ListGalleries(wdNumberGallery).ListTemplates(2).ListLevels(3).NumberPosition
Quote:
> = InchesToPoints(1)
> ListGalleries(wdNumberGallery).ListTemplates(2).ListLevels(3).TabPosition
=
> InchesToPoints(1.5)
> Insert text

> You might need to change the index number of the ListTemplates in this
> example. You might also want to change the NumberStyle and whatnot, but I
> think you get the point now. BTW, if you've only been working with VBA for
a
> week, then you're doing very, very well.

> HTH



> > Hi Dave,

> > Pardon me for being so dumb...since i have just started my VBA just a
week
> > back.

> > Anyway ... i guess from your reply that indentation is the problem.

> > My requirement goes like this..

> > '******Document BEFORE *******

> > '***** Document AFTER *********

> > Do
> > [Bullet] [tab] [some text generated from database]          - FIRST
> > PARAGRAPH DISPLAY
> > [Bullet] [tab] [some text generated from database]
> > Loop till end of record

> > Do
> > [tab] [numbered bullet] [some text generated from database]   - SECOND
> > PARAGRAPH DISPLAY   (here i have problem in indentation one level or
> tabing
> > one)
> > [tab] [numbered bullet] [some text generated from database]
> > Loop till end of record

> > Do
> > [tab] [tab] [Bullet] [some text generated from database]    - THIRD
> > PARAGRAPH DISPLAY (here also i have problem in indentation two levels or
> > tabing two )
> > [tab] [tab] [Bullet] [some text generated from database]
> > Loop till end of record

> > '*****************************
> > Can you tell me where iam going wrong. Is that indentation i have to set
> in
> > my word document for the numbering. If so, how will i do for the bullets
> > because first paragraph doesnt require any indent. In third paragraph
the
> > bullets require two indentation.

> > Appreciate your patience .

> > Krish



> > > Hi Krish

> > > '*****Document BEFORE macro*****'
> > > text [subj bookmark] [paragraph]

> > > '*****Document AFTER macro*****'
> > > text [tab][tab]SOMETEXT[paragraph]
> > > [numbered item][paragraph]

> > > Which is exactly what the macro tells it to do. Can you show me what
the
> > > document looks like first and then what you want to look like after?
> Your
> > > original query said that the macro didn't tab (which I took to mean
the
> > > macro didn't insert the tab marks in the document). I answered that
you
> > > "overwrite" those tabs when you apply the numbered list to the range
> when
> > > the bookmark is an insertion point. If you want the following:

> > > '*****Document BEFORE macro*****'
> > > [subj bookmark with no text] [paragraph]

> > > '*****Document AFTER macro*****'
> > > [numbered item][tab][tab]SOMETEXT[paragraph]
> > > [paragraph]

> > > then you'll have to redefine your numbered list style (or the
> indentation
> > of
> > > the paragraph format), I suspect.

> > > HTH



> > > > Hi Dave,

> > > > Even this didnt help. It printed the text following the number list
in
> > > next
> > > > line with tab order perfectly.

> > > > Iam not sure where iam going wrong.

> > > > Let me know if you have any other ideas.

> > > > Many thanks,
> > > > Krish



> > > > > Hi Krish,

> > > > > My apologies, should have seen that you're applying the numbered
> list
> > > the
> > > > > range. The following should take care of it (collapse the range a
> > second
> > > > > time):

> > > > > mobjRange.Collapse (wdCollapseEnd)
> > > > > mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf
> > > > > mobjRange.Collapse (wdCollapseEnd)
> > > > > mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _
> > > > >     ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1),
_
> > > > >     ContinuePreviousList:=True

> > > > > HTH



> > > > > > Hi Dave,

> > > > > > I want tabs & then number list. I tried mobjRange.InsertAfter
> vbTab
> > &
> > > > > vbTab
> > > > > > & Trim(SOMETEXT) & vbCrLf and then numbered bullet . It didnt
> work.
> > > It
> > > > > > typed the text and in the next line it shows numbered bullet.

> > > > > > Any idea.

> > > > > > Thanks,
> > > > > > Krish



> > > > > > > Hi Krish,

> > > > > > > If your mobjRange is an insertion point, then the routine
> doesn't
> > > work
> > > > > > > because you apply the number list to the range.

> > > > > > > If you want the number list and more tabs after that, then try
> the
> > > > > > > following:

> > > > > > > Dim mobjRange As Object
> > > > > > > Set mobjRange = ActiveDocument.Bookmarks.Item("subj").Range
> > > > > > > mobjRange.Collapse (wdCollapseEnd)
> > > > > > > mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate _

> ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(2),
> > _
> > > > > > >     ContinuePreviousList:=True
> > > > > > > mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) & vbCrLf

> > > > > > > HTH



> > > > > > > > Hi,

> > > > > > > > Here is newbie question .............

> > > > > > > > I am forcing tab by using vbTab, but still it doesnt tab in
> Word
> > > > > > Document
> > > > > > > > using VBA. Here is the code.

> > > > > > > > Dim mobjRange As Object
> > > > > > > > Set mobjRange = ActiveDocument.Bookmarks.Item("Subj").Range

> > > > > > > >  mobjRange.Collapse (wdCollapseEnd)
> > > > > > > >  mobjRange.InsertAfter vbTab & vbTab & Trim(SOMETEXT) &
vbCrLf
> > > > > > > >  mobjRange.Paragraphs(1).Range.ListFormat.ApplyListTemplate
_

> ListTemplate:=ListGalleries(wdNumberGallery).ListTemplates(1),
> > _
> > > > > > > > ContinuePreviousList:=True

> > > > > > > > Many Thanks,
> > > > > > > > Krish



Sat, 05 Mar 2005 02:58:25 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Settnig OBJECT property doesnt work with <PARAM tag but works in VBScript

2. SSTab Control problem-vb 4.0 (controls doesnt appear except on one tab )

3. WebBrowser ActiveX object doesnt work

4. This code used to work, now i cant figure out why it doesnt now

5. code in mdb files doesnt work

6. .OnAction doesnt work

7. Application_Startup doesnt work any trime

8. SyncEnd event doesnt work

9. why doesnt this function work as i expect?

10. This doesnt work in VB.NET

11. ctrl.GetNextControl doesnt work

12. MaxLength doesnt work, no matter what I do

 

 
Powered by phpBB® Forum Software