Copy from doc to doc with vb6 
Author Message
 Copy from doc to doc with vb6

How can I copy a peace of one Word-document
into another Word-document with VB6 and NOT
destroy the format.

I have a SUB like this where OldDoc and NySkab is
globally declared as New WORD.Document:

Sub Converter(S As String, Fn As String)
  Dim TempDoc As New Word.Document
  Set TempDoc = NySkab
  Set OldDoc = WrdApp.Documents.Open(S & Fn, , , , , , , , , , , False)

  TempDoc.Range = OldDoc.Range ' here is the problem !!!!!!!!!

  OldDoc.SaveAs S & "SIK " & Fn
  TempDoc.SaveAs S & Fn
  Set TempDoc = Nothing
  Set OldDoc = Nothing
End Sub

I think I need something like this to COPY to clipboard:

  Selection.WholeStory
  Selection.MoveLeft wdCharacter, 1, wdExtend    ' not the last paragraph
  Selection.Copy

but how can I make the 'Selection' a selection in my OldDoc ?
and how shall I paste the clipboard in my TempDoc ?

--
Keld S?rensen
Denmark



Thu, 09 Dec 2004 21:31:15 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Opening a Word97 doc as a copy with no doc title

2. Open word 97 doc with doc name as variable

3. Auto Download of doc files into new doc file from a web site

4. Auto close open doc when opening another doc

5. Saving a doc with name from doc text

6. pub doc and word doc on same screen

7. Open a doc, grab a range without having the whole doc being tabled

8. How do you drop doc files from a intranet site into a new word doc

9. Inserting a doc into another doc

10. Moving text from Doc to Doc

11. create a standard .doc from .doc form

12. Printing to doc then printing doc

 

 
Powered by phpBB® Forum Software