Select textbox

L

Lasse

Hi

I have made a macro that creates a textbox in Word 2003. I need to do two
things with the textbox. First I need to select it and then I need to create
a bookmark in it.

Can any one help me?
 
J

Jonathan West

Lasse said:
Hi

I have made a macro that creates a textbox in Word 2003. I need to do two
things with the textbox. First I need to select it and then I need to
create
a bookmark in it.

Can any one help me?

Show us the bit of code where you create the textbox. Then it will be easy
to show you how to add the extra items immediately after


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
G

Graham Mayor

Given that text boxes are not in the document text layer, it is difficult to
see how useful it would be to create a bookmark in it. Bookmarks in text
boxes are effectively invisible to the document.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
L

Lasse

' Add text box
Set s = ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 0, 0,
200, 20)
' Position
With s
.TextFrame.TextRange.InsertAfter "Inserted"
.WrapFormat.Type = wdWrapTight
.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
.Left = InchesToPoints(2.75) ' in points
.RelativeVerticalPosition = wdRelativeVerticalPositionPage
.Top = InchesToPoints(2#) ' in points
End With

Thats the code i found by searching google :)

The reaseon is that I need to create a macro that inserts city and date into
a document at a given position. My idea was to create a textbox, insert a
bookmark in the textbox and then insert city and date at the bookmark. The
text needs to be aligned to the right side of the textbox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top