Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old November 10th, 2004, 01:50 PM
christylynn christylynn is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 1 christylynn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Copy bookmarks to new document

I have a document with several bookmarks. I created a form
to list all the bookmarks and then choolse which bookmarks I
would like to add to a new document. When I click on the OK
button, either nothing happens, or it will copy all the bookmark
text. I would like it to copy the selected bookmarked text.
The macro to open up the file and bring up the file opens a new document
but nothing is added to this document. Here is the OK_click() code:

Private Sub cmdOK_Click()
'set counter to number of clauses selected
ListCounter = lstClauses.ListCount - 1

'loop through the listbox collection, and pull each clause into documet
For i = 0 To ListCounter
strParaName = lstClauses.List(i)

'this line is supposed to work, but gives me an error about "strDocumentName"
'which is used in the form.
Selection.InsertFile FileName:=strDocumentName, Range:=strParaName

'this line gets the selection but adds it to clause document.
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:=
"" & strParaName

'This line gives error about not valid bookmark
' Documents.Add DocumentType:=wdNewBlankDocument

Selection.EndKey Unit:=wdLine
Selection.TypeParagraph
Next i

'unload selection form, leaving just document on screen
Unload Me

'Highlight entire document and update the field codes
Selection.WholeStory
Selection.Fields.Update
'all text has been assembled and completed unlink text from ctrl shift f9
Selection.Fields.Unlink

'go to end of document
Selection.EndKey Unit:=wdStory

End Sub

Any help would be greatly appreciated.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Copy bookmarks to new document


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway