Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Group,
I am trying to add bookmarks and text to a word doc. I can add a bookmark using code from Excel like this: Set wdApp = CreateObject("Word.Application") Set myDoc = wdApp.Documents.Add(Template:=strDocumentNamePath) With wdApp ..Visible = True ..WindowState = wdWindowStateMinimize 'wdWindowStateMaximize End With With wrdDoc.Bookmarks .Add Name:=bName, Range:=rng .DefaultSorting = wdSortByName .ShowHidden = False End With The way that works in a word module works fine in word, but not when I try to do the same thing from excel. the word code is below: 'With ActiveDocument.Bookmarks '.Add Range:=Selection.Range, Name:="TestBookMark" '.DefaultSorting = wdSortByName '.ShowHidden = False 'End With The problem I am having is understanding how to acess/define the word document property/method (whichever it is) "Selection.Range" or Selection.xxx in the module in my excel code. I know that the "Selection" is local to the word document, but do not understand how to do a "selection" from my excel module. any info will be greatly appreciated. thanks eholz1 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
Browse a multi-pages "microsoft word document" object in Excel 200 | Excel Discussion (Misc queries) | |||
How do I move a document from "recent items" to "documents" | New Users to Excel | |||
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... | Excel Programming | |||
how can I make an excel cell "mark" or "unmark" when clicked on? | Excel Discussion (Misc queries) |