Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Publisher / Programming / July 2006

Tip: Looking for answers? Try searching our database.

use Bookmark in publisher 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ron Yeh - 25 Jul 2006 19:10 GMT
It is very awkward in Word trying to move texts and pictures.  Unless we miss
some functions in Word.  We currently looking to  move our Ventura publisher
files to MS publisher files. We intend to try publisher application due to
its ease of moving picture and text on a page.  However, it is not so easy as
in Word to put SQL database info (stored procedure with parameters) into
"proper spot" on Publisher files.  Can you make Bookmark in Publisher 2007 as
good as the bookmark in Word 2000 programmatically ?  right now I have to use
code like this:
   Dim strName As String, numh As Double, shp1 As Shape
'    strName = ActiveDocument.Pages(1).Shapes.Item(2).TextFrame.TextRange.Text
   
   For Each shp1 In ActiveDocument.Pages(1).Shapes
       If shp1.Type = pbTable Then
           Debug.Print shp1.Table.Columns(1).Cells(1).TextRange.WordsCount
           If shp1.Table.Columns(1).Cells(1).TextRange.WordsCount > 1 Then
               shp1.Table.Columns(1).Cells(1).TextRange.Words(1).Select
               shp1.Table.Columns(1).Cells(1).TextRange.Delete
'                shp1.Table.Columns(1).Cells(1).TextRange.Collapse
(pbCollapseEnd)
           End If
               
           shp1.Table.Columns(1).Cells(1).TextRange.InsertAfter
("CodeNumaddaaa")
           
       End If
   Next

This is not good if there's a change on the table.  
Signature

A Programmer on Office Automation

Ed Bennett - 25 Jul 2006 21:26 GMT
> Can you make Bookmark in Publisher 2007 as
> good as the bookmark in Word 2000 programmatically ?  right now I have to use
> code like this:

I've not used the bookmark in Word 2000, so am not sure what it is
supposed to accomplish. Could you create a Collection object and add
TextRanges or Cells to it?

Signature

Ed Bennett - MVP Microsoft Publisher
http://ed.mvps.org

Ron Yeh - 26 Jul 2006 15:15 GMT
thanks for your reply.
Here's what I used to do in Word 2000
Preparation:
In Word 2000:  Create a template with bookmarks using fieldname of a
recordset from ACCESS  as the bookmark name
In VB6 program:
start the Word 2000 app and open the *.dot file
Get the ACCESS  recordset then loop through the fieldname of the recordset
call InsertAtBookmark(wordobj, fieldname, fieldvalue)

Public Function InsertAtBookmark(objWordDoc As Object, strBookmark As
String, strText As String) As Boolean
   With objWordDoc.bookmarks
       If .exists(strBookmark) Then
           .Item(strBookmark).Range.Text = strText
           adhInsertAtBookmark = True
       End If
   End With
End Function

the bookmark of Word 2000 can let me know the exact location on the document
and I don't have to worry about the row number, column number.....  

If Publisher 2007 can have the same feature, that will be excellent.   Or
There exist a better way that I am not aware of.

Ed's suggestion of creating a collection, adding the cells, text ranges to
the collection does not reduce the trouble of finding the exact row number,
column number, text ranges, ...

Signature

A Programmer on Office Automation

> > Can you make Bookmark in Publisher 2007 as
> > good as the bookmark in Word 2000 programmatically ?  right now I have to use
[quoted text clipped - 3 lines]
> supposed to accomplish. Could you create a Collection object and add
> TextRanges or Cells to it?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.