Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default copy and paste to doc

guru

After you Paste into Word, you can use

APPWD.ActiveDocument.Windows(1).View.TableGridLine s = False

to hide the gridlines.

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"guru" wrote in message
...
I am using the next code in order to copy a range from a sheet to a word
document
The problem is that this copy takes the gridlines from the sheet and

creates
tables in word
document .
How can i prevent the gridlines not to be paste in the doc.?


Sub wordexport()
Worksheets("PRAKTIKO_ISOL").Select
''''''CREATE WORD and copy range to it

Application.CutCopyMode = xlCut
Application.DisplayAlerts = False
On Error Resume Next
Dim APPWD As Object
Dim finalrow As Long
Dim i As Integer
Set APPWD = CreateObject("Word.Application")
APPWD.Visible = True

Sheets("PRAKTIKO_ISOL").Select

'Find the last row with data in the database
finalrow = Range("A9999").End(xlUp).Row

Range(Cells(1, 1), Cells(finalrow, 5)).Copy

' Tell Word to create a new document
APPWD.Documents.Add

' Tell Word to paste the contents of the clipboard into

the
new document
APPWD.Selection.Paste

Application.CutCopyMode = xlCut


''''' fix document margins
With APPWD.ActiveDocument.PageSetup
.LineNumbering.Active = False
.LeftMargin = Application.InchesToPoints(1)
.RightMargin = Application.InchesToPoints(1)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(1.25)
.FooterMargin = Application.InchesToPoints(1.25)
End With


Application.DisplayAlerts = True

End Sub




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Copy and Paste or Paste Special between Excel Workbooks wllee Excel Discussion (Misc queries) 5 April 29th 23 03:43 AM
Copy, paste without file name referenced after paste AusTexRich Excel Discussion (Misc queries) 6 September 23rd 08 02:57 AM
Copy; Paste; Paste Special are disabled Mack Neff[_3_] Excel Discussion (Misc queries) 0 April 28th 08 06:29 PM
Excel cut/Paste Problem: Year changes after data is copy and paste Asif Excel Discussion (Misc queries) 2 December 9th 05 05:16 PM
I cannot paste from one workbook to another. Copy works, paste do. JimmyMc Excel Discussion (Misc queries) 1 June 10th 05 03:54 PM


All times are GMT +1. The time now is 09:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"