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 / September 2005

Tip: Looking for answers? Try searching our database.

Add content on same doc.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bala - 07 Sep 2005 17:20 GMT
Hi all,

one of my word doc contain 20 pages. For example, I want to paste the pages
2,5,10 to another document thru vb program. the page nos will vary depends on
users choice. so i using below code. the tmptotal contain no of total pages.
i dont know how to add each pages into same document. currently i can able to
add a seperate a document. the below code i am using currently. anyone give
me idea to solve this.

thanks
bala

code:

For i = 1 To tmptotal
       If i = 1 Or i = 4 Or i = 6 Then
           objWord.ActiveDocument.Bookmarks("\page").Range.Copy
           objwordtarget.Documents.Add.Content.Paste
           objwordtarget.Visible = True
       End If
        objWord.Application.Browser.Next
   Next
Bala - 07 Sep 2005 17:46 GMT
No Problem. got it. here is the code

For i = 1 To tmptotal
       If i = 1 Or i = 4 Or i = 6 Then
           objWord.ActiveDocument.Bookmarks("\page").Range.Copy
               If i = 1 Then
                   With objwordtarget
                       .Documents.Add
                   End With
               End If
               With objwordtarget
                   
                   .Selection.Paste
               End With
          objwordtarget.Visible = True
       End If
        objWord.Application.Browser.Next
   Next

thanks
bala

> Hi all,
>
[quoted text clipped - 18 lines]
>          objWord.Application.Browser.Next
>     Next
 
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.