-
The API command's are handy for some things. I used FindWindow() to check and see if MSWord was already open. I used BringWIndowToTop() to try and set the focus.
As for the cell references, just add what you need.
e.g. For absolute cell reference:
[VBA].TypeText Excel.Range("P1").Value[/VBA]
to offset to the preceeding row in column P from the current row:
[VBA].TypeText Excel.Range("P" & cRow).Offset(-1,0).Value[/VBA]
Generally, I would prefer to use bookmarks or FormFields to poke data into a pre-build doc.
Here are some threads that I have posted to.
'TypeText method
'http://www.excelforum.com/excel-programming/650672-populate-word-document-from-excel.html#post1946784
'http://www.excelforum.com/showthread.php?p=1946784
'FormFields
'http://www.mrexcel.com/forum/showthread.php?p=1639696
'http://www.mrexcel.com/forum/showthread.php?t=333200
'Add Hyperlink to Bookmark
'http://www.excelforum.com/excel-programming/664078-use-excel-vba-to-add-a-hyperlink-to-a-word-document.html#post2006430
'Save OLEObject as MSWord Document
'http://vbaexpress.com/forum/showthread.php?t=21619
'Add Table to MSWord
'http://vbaexpress.com/forum/showthread.php?t=23975
'http://vbaexpress.com/forum/showthread.php?p=168731
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules