Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

Using insertfile for documents with customized outline numbering

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hanashi_Aru - 14 Dec 2004 06:59 GMT
Hi. Need help.

I have a template with macro VBA code in it that does the following --

Selection.InsertFile FileName:="\\server\share\folder\EXAMPLE.DOC", _
       Range:="", ConfirmConversions:=False, Link:=False, Attachment:=False

Selection.InsertBreak Type:=wdPageBreak

For a list of documents in an array.

Problem: I am having problems with certain documents showing their custom
"Outline Numbering" after the insertfile is finished.
Jean-Guy Marcil - 14 Dec 2004 14:54 GMT
Hanashi_Aru was telling us:
Hanashi_Aru nous racontait que :

> Hi. Need help.
>
[quoted text clipped - 10 lines]
> Problem: I am having problems with certain documents showing their
> custom "Outline Numbering" after the insertfile is finished.

And I have a problem understanding your problem!
Can you be a bit more explicit and describe the result and the expected
behaviour?

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Hanashi_Aru - 14 Dec 2004 15:31 GMT
Thank you for your reply Jean-Guy.

What I want to have happen is something like this:
If the document has the following outline numbering used, I want it to
appear in the file where insertfile was used (There should be an indentation
at level 2.)

1. This is level 1.
   a. This is level 2, first line.
   b. This is level 2, second line.

The result of the problem is something like:
  This is level 1.
     This is level 2, first line.
     This is level 2, second line.

> Hanashi_Aru was telling us:
> Hanashi_Aru nous racontait que :
[quoted text clipped - 17 lines]
> Can you be a bit more explicit and describe the result and the expected
> behaviour?
Jean-Guy Marcil - 14 Dec 2004 15:51 GMT
Hanashi_Aru was telling us:
Hanashi_Aru nous racontait que :

> Thank you for your reply Jean-Guy.
>
[quoted text clipped - 11 lines]
>      This is level 2, first line.
>      This is level 2, second line.

Numbered lists are a real can of worms, especially when moving them between
documents.
Using just the code you provided I could not reproduce your problem on Word
2003. What is your Word version?

Sometimes this can be fixed by doing a paragraph reset on the inserted text
(CTRL-Q after having selected the problem text, or, in VBA:
Selection.Paragraphs.Reset). But mostly, it really depends on how the
outline list was created and if styles are involved or not.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Hanashi_Aru - 14 Dec 2004 18:49 GMT
Thanks.  Ctrl-Q works a little, but I still have to go in and adjust the
levels.= by indenting.

I am using Word 2002. But the problem was discovered with Word 2000.

The custom outline numbering was based on one of the standard ones from the
outline numbering template list.  I called this custom outline numbering
BSList.

> Hanashi_Aru was telling us:
> Hanashi_Aru nous racontait que :
[quoted text clipped - 24 lines]
> Selection.Paragraphs.Reset). But mostly, it really depends on how the
> outline list was created and if styles are involved or not.
Jean-Guy Marcil - 15 Dec 2004 20:42 GMT
Hanashi_Aru was telling us:
Hanashi_Aru nous racontait que :

> Thanks.  Ctrl-Q works a little, but I still have to go in and adjust
> the levels.= by indenting.
[quoted text clipped - 4 lines]
> from the outline numbering template list.  I called this custom
> outline numbering BSList.

If even the indent get out of whack, then I suspect there is something wrong
in the way your outline numbering is set up. That you lose the numbers is
"normal"(I mean it has been seen and is expected behaviour) with Word when
paragraphs are moved from one document to another.

Make sure you set up your styles as outlined in this article.
   http://www.shaunakelly.com/word/numbering/OutlineNumbering.html

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Hanashi_Aru - 15 Dec 2004 21:33 GMT
Thanks so much for replies. We'll leave it at that for this subject.

From my personal experience, there seems to be a few too many things that
have to be considered when using insertfile.

With that, I changed the code to use documents.open, as a starting point.
Have more documents opening, but at least the outline numbering and everthing
else is preserved.

> Hanashi_Aru was telling us:
> Hanashi_Aru nous racontait que :
[quoted text clipped - 15 lines]
> Make sure you set up your styles as outlined in this article.
>     http://www.shaunakelly.com/word/numbering/OutlineNumbering.html

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.