Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Reposting to get your kind attention

Hi all,


I have been trying two weeks to find a solution to this problem. I
have posted this in 6+ groups. Unfortunately, I am not able to get some
attention to this problem. I am reposting this again, just incase if
someone finds this problem interesting....Thanks for your kind
attention...


The original problem is as below...


I am trying to generate couple of word documents from excel sheet. I
start with word template file with enclosing bookmarks to insert text
and objects from excel. I have to add three things to the word
document.
1. project name
2. pad drawing
3. table of data


I am able to successfully replace the bookmarks when I use text. But
when I try to copy the drawing(a picture), it doesn't work. Also I try
to copy a table and that doesn't work. I don't know what I am doing
wrong. Or do you have a better suggestion. The code is shown below.
Thanks in advance for correcting me with your suggestions.


shishi


Sub GenerateDocs()


Dim oWrd As Word.Application
Dim oDoc As Word.Document


Set oWrd = New Word.Application
oWrd.Visible = False


proj = ThisWorkbook.Sheets("DOC").Ran**ge("PROJECT_NAME") .Value
Set phook = ThisWorkbook.Sheets("DOC").Ran**ge("DRAWING_LOC")
Set pdCell = ThisWorkbook.Sheets("DOC").Ran**ge("PAD_DESCRIPTIO N")


Set oDoc = oWrd.Documents.Open("U:\proj44**6\DocTemplate.dot" )
oDoc.Bookmarks("ProjName").Ran**ge.Text = proj
Set ToCell = oDoc.Bookmarks("PadHook").Rang**e
Set TableCell = oDoc.Bookmarks("PdTable").Rang**e


With Worksheets("DOC")
.Range(phook).Copy Destination:=ToCell
.Range(pdCell, pdCell.End(xlDown).End(xlToRig**ht)).Copy
Destination:=TableCell
End With


oDoc.SaveAs CurDir & "\test.doc"
oDoc.Close


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
Reposting - Countif subtotals katagrga Excel Discussion (Misc queries) 2 June 5th 09 03:17 PM
Reposting - Why would this not Clear Cells Roger Excel Discussion (Misc queries) 4 January 30th 08 03:15 PM
Reposting for help with Outlook from Excel Jenny B. Excel Discussion (Misc queries) 2 January 14th 08 06:57 PM
Sorry for reposting - but this is driving me crazy! Bean123r Excel Discussion (Misc queries) 1 January 27th 06 02:31 PM
Reposting to get some answers...... shishi Excel Programming 1 August 5th 05 04:31 PM


All times are GMT +1. The time now is 03:01 AM.

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

About Us

"It's about Microsoft Excel"