PC Review


Reply
Thread Tools Rate Thread

Cutting and Pasting Numberd lists

 
 
=?Utf-8?B?UGV0ZXIgS2FybHN0csO2bQ==?=
Guest
Posts: n/a
 
      18th Oct 2007
Hi

I have developed a COM-Addin with a function which inserts text in a
document from another document (a type of template document).
The Addin shows a form in which the user choose the text from choices in a
database. The database states the file path and the bookmark from where to
get the text.
This works fine until we added numbered lists in the templates. (the
templates are ordinary doc-files with more than 1 numbered list).
The problem occurs when we cut and paste the second list in the template
document. The first list from the template works fine.
In the target document, number 1 in the list is lost and number 2 from the
template becomes number 1.
We have tried every possible way to format the lists in the template with no
success.

We get the same problem when we try this manually so we belive the problem
is not in the code, rather than in the formatting och either the template
document or the target document.

Is there anybody who has a clue?

--
Peter Karlström
Midrange AB
Sweden
 
Reply With Quote
 
 
 
 
Stefan Blom
Guest
Posts: n/a
 
      19th Oct 2007
Have you considered pasting as unformatted text, which pastes autonumbers as
fixed numbers (as if they were typed in)?

--
Stefan Blom
Microsoft Word MVP


"Peter Karlström" wrote in message
news:63EF8FAC-1AAE-40BE-BF0B-(E-Mail Removed)...
> Hi
>
> I have developed a COM-Addin with a function which inserts text in a
> document from another document (a type of template document).
> The Addin shows a form in which the user choose the text from choices in a
> database. The database states the file path and the bookmark from where to
> get the text.
> This works fine until we added numbered lists in the templates. (the
> templates are ordinary doc-files with more than 1 numbered list).
> The problem occurs when we cut and paste the second list in the template
> document. The first list from the template works fine.
> In the target document, number 1 in the list is lost and number 2 from the
> template becomes number 1.
> We have tried every possible way to format the lists in the template with
> no
> success.
>
> We get the same problem when we try this manually so we belive the problem
> is not in the code, rather than in the formatting och either the template
> document or the target document.
>
> Is there anybody who has a clue?
>
> --
> Peter Karlström
> Midrange AB
> Sweden





 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgS2FybHN0csO2bQ==?=
Guest
Posts: n/a
 
      22nd Oct 2007
Hi Stefan

Yes we have, but the whole idea is that the people who administrate the
texts to use throughout the company can format the text as it should appear in
the final document, with format and all.

We have concider breaking up the template documents to several documents as
an escape route to the problem, but that makes the administration more
complicated, since we are talking about a severe number of texts.
The goal was to have one template document to each department.

Is this a known bug to Word?

Thanks in advance
--
Peter Karlström
Midrange AB
Sweden


"Stefan Blom" wrote:

> Have you considered pasting as unformatted text, which pastes autonumbers as
> fixed numbers (as if they were typed in)?
>
> --
> Stefan Blom
> Microsoft Word MVP
>
>
> "Peter Karlström" wrote in message
> news:63EF8FAC-1AAE-40BE-BF0B-(E-Mail Removed)...
> > Hi
> >
> > I have developed a COM-Addin with a function which inserts text in a
> > document from another document (a type of template document).
> > The Addin shows a form in which the user choose the text from choices in a
> > database. The database states the file path and the bookmark from where to
> > get the text.
> > This works fine until we added numbered lists in the templates. (the
> > templates are ordinary doc-files with more than 1 numbered list).
> > The problem occurs when we cut and paste the second list in the template
> > document. The first list from the template works fine.
> > In the target document, number 1 in the list is lost and number 2 from the
> > template becomes number 1.
> > We have tried every possible way to format the lists in the template with
> > no
> > success.
> >
> > We get the same problem when we try this manually so we belive the problem
> > is not in the code, rather than in the formatting och either the template
> > document or the target document.
> >
> > Is there anybody who has a clue?
> >
> > --
> > Peter Karlström
> > Midrange AB
> > Sweden

>
>
>
>
>

 
Reply With Quote
 
Stefan Blom
Guest
Posts: n/a
 
      22nd Oct 2007
I wouldn't call it a bug, exactly... The problem with pasting numbered items
from different sources is that it might be difficult to control which
numbered items are part of the same list and which are not. Especially note
that if numbering is applied with paragraph styles (which is the most stable
way), items of the same style are definitely part of the same list.

Instead of pasting as unformatted text you could convert the numbering to
text in the source documents before pasting it. That would preserve the
numbers (as typed-in characters), but still leave any other formatting
intact.

To convert the auto numbers in a range to text, run this macro:

Selection.Range.ListFormat.ConvertNumbersToText

(Note that I used Selection.Range, but you can specify a different range
object if you want to.)

And to convert all numbers in a document, run this macro:

ActiveDocument.ConvertNumbersToText

--
Stefan Blom
Microsoft Word MVP


"Peter Karlström" wrote in message
news:6F75B6AD-04A9-4356-86FC-(E-Mail Removed)...
> Hi Stefan
>
> Yes we have, but the whole idea is that the people who administrate the
> texts to use throughout the company can format the text as it should
> appear in
> the final document, with format and all.
>
> We have concider breaking up the template documents to several documents
> as
> an escape route to the problem, but that makes the administration more
> complicated, since we are talking about a severe number of texts.
> The goal was to have one template document to each department.
>
> Is this a known bug to Word?
>
> Thanks in advance
> --
> Peter Karlström
> Midrange AB
> Sweden
>
>
> "Stefan Blom" wrote:
>
>> Have you considered pasting as unformatted text, which pastes autonumbers
>> as
>> fixed numbers (as if they were typed in)?
>>
>> --
>> Stefan Blom
>> Microsoft Word MVP
>>
>>
>> "Peter Karlström" wrote in message
>> news:63EF8FAC-1AAE-40BE-BF0B-(E-Mail Removed)...
>> > Hi
>> >
>> > I have developed a COM-Addin with a function which inserts text in a
>> > document from another document (a type of template document).
>> > The Addin shows a form in which the user choose the text from choices
>> > in a
>> > database. The database states the file path and the bookmark from where
>> > to
>> > get the text.
>> > This works fine until we added numbered lists in the templates. (the
>> > templates are ordinary doc-files with more than 1 numbered list).
>> > The problem occurs when we cut and paste the second list in the
>> > template
>> > document. The first list from the template works fine.
>> > In the target document, number 1 in the list is lost and number 2 from
>> > the
>> > template becomes number 1.
>> > We have tried every possible way to format the lists in the template
>> > with
>> > no
>> > success.
>> >
>> > We get the same problem when we try this manually so we belive the
>> > problem
>> > is not in the code, rather than in the formatting och either the
>> > template
>> > document or the target document.
>> >
>> > Is there anybody who has a clue?
>> >
>> > --
>> > Peter Karlström
>> > Midrange AB
>> > Sweden

>>
>>
>>
>>
>>




 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgS2FybHN0csO2bQ==?=
Guest
Posts: n/a
 
      22nd Oct 2007
Hi Stefan

Thanks for your reply.

With your suggestion it seems we have three ways to solve this:
1. Use your suggestion and convert the numbered lists to text.
2. Breake up the template document to only consist of 1 numbered list per
template.
3. Hard code som reformating after the paste in the target document.

I will let the customer to deside.

Thanks again

--
Peter Karlström
Midrange AB
Sweden


"Stefan Blom" wrote:

> I wouldn't call it a bug, exactly... The problem with pasting numbered items
> from different sources is that it might be difficult to control which
> numbered items are part of the same list and which are not. Especially note
> that if numbering is applied with paragraph styles (which is the most stable
> way), items of the same style are definitely part of the same list.
>
> Instead of pasting as unformatted text you could convert the numbering to
> text in the source documents before pasting it. That would preserve the
> numbers (as typed-in characters), but still leave any other formatting
> intact.
>
> To convert the auto numbers in a range to text, run this macro:
>
> Selection.Range.ListFormat.ConvertNumbersToText
>
> (Note that I used Selection.Range, but you can specify a different range
> object if you want to.)
>
> And to convert all numbers in a document, run this macro:
>
> ActiveDocument.ConvertNumbersToText
>
> --
> Stefan Blom
> Microsoft Word MVP
>
>
> "Peter Karlström" wrote in message
> news:6F75B6AD-04A9-4356-86FC-(E-Mail Removed)...
> > Hi Stefan
> >
> > Yes we have, but the whole idea is that the people who administrate the
> > texts to use throughout the company can format the text as it should
> > appear in
> > the final document, with format and all.
> >
> > We have concider breaking up the template documents to several documents
> > as
> > an escape route to the problem, but that makes the administration more
> > complicated, since we are talking about a severe number of texts.
> > The goal was to have one template document to each department.
> >
> > Is this a known bug to Word?
> >
> > Thanks in advance
> > --
> > Peter Karlström
> > Midrange AB
> > Sweden
> >
> >
> > "Stefan Blom" wrote:
> >
> >> Have you considered pasting as unformatted text, which pastes autonumbers
> >> as
> >> fixed numbers (as if they were typed in)?
> >>
> >> --
> >> Stefan Blom
> >> Microsoft Word MVP
> >>
> >>
> >> "Peter Karlström" wrote in message
> >> news:63EF8FAC-1AAE-40BE-BF0B-(E-Mail Removed)...
> >> > Hi
> >> >
> >> > I have developed a COM-Addin with a function which inserts text in a
> >> > document from another document (a type of template document).
> >> > The Addin shows a form in which the user choose the text from choices
> >> > in a
> >> > database. The database states the file path and the bookmark from where
> >> > to
> >> > get the text.
> >> > This works fine until we added numbered lists in the templates. (the
> >> > templates are ordinary doc-files with more than 1 numbered list).
> >> > The problem occurs when we cut and paste the second list in the
> >> > template
> >> > document. The first list from the template works fine.
> >> > In the target document, number 1 in the list is lost and number 2 from
> >> > the
> >> > template becomes number 1.
> >> > We have tried every possible way to format the lists in the template
> >> > with
> >> > no
> >> > success.
> >> >
> >> > We get the same problem when we try this manually so we belive the
> >> > problem
> >> > is not in the code, rather than in the formatting och either the
> >> > template
> >> > document or the target document.
> >> >
> >> > Is there anybody who has a clue?
> >> >
> >> > --
> >> > Peter Karlström
> >> > Midrange AB
> >> > Sweden
> >>
> >>
> >>
> >>
> >>

>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cutting and Pasting Whoopex Microsoft Excel Discussion 3 16th Oct 2006 08:27 PM
Cutting and Pasting =?Utf-8?B?QWtpcmE=?= Windows XP Basics 12 25th Aug 2006 08:10 PM
Cutting and Pasting Mark Bennett Microsoft Powerpoint 4 16th Jan 2004 05:16 AM
cutting and pasting daniel Microsoft Windows 2000 0 21st Oct 2003 06:02 AM
Cutting and Pasting Abe Frohnman Microsoft C# .NET 1 30th Jul 2003 12:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:14 AM.