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 / Word / Programming / June 2007

Tip: Looking for answers? Try searching our database.

Select textbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lasse - 15 Jun 2007 14:36 GMT
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?
Jonathan West - 15 Jun 2007 15:19 GMT
> Hi
>
[quoted text clipped - 4 lines]
>
> 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

Signature

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

Lasse - 18 Jun 2007 07:15 GMT
' 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.

> > Hi
> >
[quoted text clipped - 7 lines]
> 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
Graham Mayor - 15 Jun 2007 15:32 GMT
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.

Signature

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Hi
>
[quoted text clipped - 3 lines]
>
> Can any one help me?
 
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.