create a textbox from VBA

How do I place a textbox on my page and center the text in the box from VBA?


0
Lisa3283 (2)
1/6/2004 8:42:54 PM
visio 3638 articles. 1 followers. Follow

4 Replies
1986 Views

Similar Articles

[PageSpeed] 13

The "Circle Shape" example at www.mvps.org/visio/VBA.htm shows how to use
DrawRectangle to create a shape. You should be able to see how to manipulate
text in one of the other examples.

John...    Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples?   http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
"Lisa" <Lisa@nomail.com> wrote in message
news:OM3eSXJ1DHA.2872@TK2MSFTNGP09.phx.gbl...
> How do I place a textbox on my page and center the text in the box from
VBA?
>
>


0
lancucki (505)
1/6/2004 9:12:19 PM
I have a similar example on how to draw a rectangle and put text into it.
But how do I set the line around the box to "no line" and how do I set the
font and font size?

I have searched the VBA help but without any luck. So I was just hoping for
an example doing exactly what I was looking for....But I guess I can find
most of it in the examples you refer to.

Lisa

"John Marshall, MVP" <lancucki@stonehenge.ca> wrote in message
news:%23QwUHnJ1DHA.4060@TK2MSFTNGP11.phx.gbl...
> The "Circle Shape" example at www.mvps.org/visio/VBA.htm shows how to use
> DrawRectangle to create a shape. You should be able to see how to
manipulate
> text in one of the other examples.
>
> John...    Visio MVP
>
> Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
> Need VBA examples?   http://www.mvps.org/visio/VBA.htm
> Common Visio Questions http://www.mvps.org/visio/common_questions.htm
> "Lisa" <Lisa@nomail.com> wrote in message
> news:OM3eSXJ1DHA.2872@TK2MSFTNGP09.phx.gbl...
> > How do I place a textbox on my page and center the text in the box from
> VBA?
> >
> >
>
>


0
Lisa3283 (2)
1/6/2004 10:34:21 PM
these functions (font, font-size, and 'no-line') all come about by way of
manipulating the cells within an object. The easy way would be to read
either David Edson's book or Graham Wideman's book. However a more 'fun' way
is to experiment with the paragraph, character (char.font, char.size), line
format, and fill format sections of the shape sheet.
Al
"Lisa" <Lisa@nomail.com> wrote in message
news:eXwJkVK1DHA.2948@TK2MSFTNGP09.phx.gbl...
> I have a similar example on how to draw a rectangle and put text into it.
> But how do I set the line around the box to "no line" and how do I set the
> font and font size?
>
> I have searched the VBA help but without any luck. So I was just hoping
for
> an example doing exactly what I was looking for....But I guess I can find
> most of it in the examples you refer to.
>
> Lisa
>
> "John Marshall, MVP" <lancucki@stonehenge.ca> wrote in message
> news:%23QwUHnJ1DHA.4060@TK2MSFTNGP11.phx.gbl...
> > The "Circle Shape" example at www.mvps.org/visio/VBA.htm shows how to
use
> > DrawRectangle to create a shape. You should be able to see how to
> manipulate
> > text in one of the other examples.
> >
> > John...    Visio MVP
> >
> > Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
> > Need VBA examples?   http://www.mvps.org/visio/VBA.htm
> > Common Visio Questions http://www.mvps.org/visio/common_questions.htm
> > "Lisa" <Lisa@nomail.com> wrote in message
> > news:OM3eSXJ1DHA.2872@TK2MSFTNGP09.phx.gbl...
> > > How do I place a textbox on my page and center the text in the box
from
> > VBA?
> > >
> > >
> >
> >
>
>


0
edlund1 (616)
1/7/2004 12:37:16 AM
Or the lazy way.

Use the macro recorder in Visio 2003 and see what results you get.

Sub Macro1()
    Dim vsoCharacters1 As Visio.Characters

    Application.ActiveWindow.Page.DrawRectangle 2.75, 9.25, 4.75, 8#

    Set vsoCharacters1 =
Application.ActiveWindow.Page.Shapes.ItemFromID(1).Characters
    vsoCharacters1.Begin = 0
    vsoCharacters1.End = 0
    vsoCharacters1.Text = "teststring"


Application.ActiveWindow.Page.Shapes.ItemFromID(1).CellsSRC(visSectionObject
, visRowLine, visLinePattern).FormulaU = "0"

Application.ActiveWindow.Page.Shapes.ItemFromID(1).CellsSRC(visSectionCharac
ter, 0, visCharacterFont).FormulaU = "75"

Application.ActiveWindow.Page.Shapes.ItemFromID(1).CellsSRC(visSectionCharac
ter, 0, visCharacterSize).FormulaU = "36 pt"


End Sub

-- 
John...    Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples?   http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
"Al Edlund" <edlund@ameritech.net> wrote in message
news:eXWioZL1DHA.2156@TK2MSFTNGP12.phx.gbl...
> these functions (font, font-size, and 'no-line') all come about by way of
> manipulating the cells within an object. The easy way would be to read
> either David Edson's book or Graham Wideman's book. However a more 'fun'
way
> is to experiment with the paragraph, character (char.font, char.size),
line
> format, and fill format sections of the shape sheet.
> Al
> "Lisa" <Lisa@nomail.com> wrote in message
> news:eXwJkVK1DHA.2948@TK2MSFTNGP09.phx.gbl...
> > I have a similar example on how to draw a rectangle and put text into
it.
> > But how do I set the line around the box to "no line" and how do I set
the
> > font and font size?
> >
> > I have searched the VBA help but without any luck. So I was just hoping
> for
> > an example doing exactly what I was looking for....But I guess I can
find
> > most of it in the examples you refer to.
> >
> > Lisa
> >
> > "John Marshall, MVP" <lancucki@stonehenge.ca> wrote in message
> > news:%23QwUHnJ1DHA.4060@TK2MSFTNGP11.phx.gbl...
> > > The "Circle Shape" example at www.mvps.org/visio/VBA.htm shows how to
> use
> > > DrawRectangle to create a shape. You should be able to see how to
> > manipulate
> > > text in one of the other examples.
> > >
> > > John...    Visio MVP
> > >
> > > Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
> > > Need VBA examples?   http://www.mvps.org/visio/VBA.htm
> > > Common Visio Questions http://www.mvps.org/visio/common_questions.htm
> > > "Lisa" <Lisa@nomail.com> wrote in message
> > > news:OM3eSXJ1DHA.2872@TK2MSFTNGP09.phx.gbl...
> > > > How do I place a textbox on my page and center the text in the box
> from
> > > VBA?
> > > >
> > > >
> > >
> > >
> >
> >
>
>


0
lancucki (505)
1/7/2004 2:12:55 AM
Reply:

Similar Artilces:

Newbie needs to create a database program!!!
Hi, I want to create a simple database program using CDataBase and CRecordSet in MFC but not using wizard.I want to write the code using the above.What are the steps for doing so and Please tell me how to start and do include sample codes for simple DB programs if possible.Thanx in advance..................I have done it with wizard,now i want to write the code so as to understand it better.I am using MSVC++6.0 Create a Console project (make sure to select MFC support) and in the main window, type: try { CDatabase dbase; dbase.Open( _T( "UID=sa;PWD=<pwd>;DATABASE=Nortwind;SERVER...

Delayed Email how can I tell when it was created?
How can I tell when a an email was created I have a user that may be using delayed send to "cover his time" I have used the field chooser to display the created field but it gives me the same time the message was scheduled to send Even if the delay is used, the sent time will still be the same as the time the sender pressed Send. If I create a message now -- 7:07 PM my time -- and say I want it delievered at 10:00 PM, but I press Send at 7:07, the message will show up as having been sent at 7:07...not 10:00. -- Jocelyn Fiorello MVP - Outlook *** Messages sent to my e-mail ...

VBA Crashes Outlook Express
Hi All I've got a WorkBook form a college, and for some reason, it makes O crash. When i try to open OE it does open, but it takes forever. W have tried it on different computers, and OE crashed all the time. All the code does is prevent users from changing some values, hid sheets, set up print options. It removes the original Menu Bar and replace it with another, but it' all set back Before_Close. It contains: Application.ScreenUpdating = False Application.DisplayAlerts = False Application.EnableEvents = False but their all set back to True Before_Close. Anyone else who has come...

Creating Publisher Output from an Access Database
Hi, I would like to know whether it is possible to do something like this with MS Publisher 2003, without any kind of programming (VB or any other kind of coding): Let's say I am a teacher and have an Access database of different books (tables contain fields such as Author, synopsis, reviews etc.). Now I would like to create reading lists for different students using MS Publisher, where each list is a unique combination of books, with relevant information from each book being pulled from the database. Would it be possible to design some kind of Publisher document or template, and then ...

Is it possible to create 3 Y-axes in one chart?
I need to make charts with three different y - axis. To my knowledge, Excel allows only two y-axes. Any suggestions besides using Harvard Graphics? Rajan Hi, Take a look at Jon Peltier's work around. http://peltiertech.com/Excel/Charts/TertiaryAxis.html Cheers Andy Rajan Varadan wrote: > I need to make charts with three different y - axis. To my knowledge, Excel > allows only two y-axes. Any suggestions besides using Harvard Graphics? > Rajan -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info ...

OWA-SSL: Should I use 3rd party certificate or create own CA
My partner and I are debating the use of a third party certificate (like Verisign) or the creation of our own Certificate Authority. We want our users to access OWA via ssl. I thought we should use third part certs because then we wouldn't have to worry about browsers having or not having our public key. I thought we would have to install that key on each machine that someone wanted to use to access OWA. My partner thinks that we could create our own CA using Windows 2000 server and create the certs. He believes that IE would already have the public key for certs created by our M...

Create a lookup field in CRM3.0
Can I create a lookup field in Quote and this field is referenced to another entity(eg. user in CRM system)? ---I mean: this field is a lookup field, the picklist is all user in CRM system. Is CRM3.0 support is function? Can anyone can help me? Thanks -- Richard CRM 3.0 does not support creating new relationships (or their lookups) between system entities so the answer is no, sorry.. Peter Lynch "Richard Jin" <RichardJin@discussions.microsoft.com> wrote in message news:E6041321-457B-4F32-9620-AF688FABC96C@microsoft.com... > Can I create a lookup field in Quote a...

PDF Files created from Word 2007
If I save a file in PDF format and send it to someone as a n attachment, will they be able to modify it if they have adobe software. If so how do I make it so they can't change the original document thanks BV On Mar 5, 6:48=A0pm, Techtrainer <Techtrai...@discussions.microsoft.com> wrote: > If I save a file in PDF format and send it to someone as a n attachment, = will > they be able to modify it if they have adobe software. If so how do I mak= e it > so they can't change the original document > thanks > BV One way to prevent editing is to print o...

a question about creating mailbox enabled users in AD
Let's say i have 1 2k server that is a DC and one 2k member server. i have exchange 2000 installed on the member server and the member server is of course part of the DC's domain. i thought that i could just go into AD Users and Computers on the domain controller, create a new user account and that i would get the option to create them a mailbox as well. But i never got the screen that has the check box in it to create the new user a mailbox. it was not until i went to the exchange box, brought up an MMC and threw AD Users and Computers in it, and created the new user from there that i...

java message with VBA
You can import www site with Excel, but only those parts which writes in HTML. Java applet seems to disappear. Is there any possibility to intercept the java message (text) with VBA <SCRIPT LANGUAGE="JavaScript"> function choiceCheck() { var nrTable=new Array("119b/05",-1); var timeTable=new Array("07:16","09:50",-1); var dateTable=new Array("23-06-2005","23-06-2005",-1); � so on This part of data will not appear Any suggestion Thanks Don't see how, as that is an instruction to HTTP to run that c...

AutoArchive creates new Personal Folders object (3'rd request for help)
Using Outlook 2002 (10.3513.3501) SP-1. Whenever I run an AutoArchive, it finishes with an 'operation failed' = error, and a new folders object named 'Personal Folders' is created. The = new folder is not linked to a .PST, and is easily removed using the Data = Files dialog. However, it returns with each AutoArchive. :-( Is there a solution to the problem? I found a posting that suggested that the deletion of all the name/value = pairs of the profile's registry key might solve a similar problem. What = potential problems might result from attempting this? I'd of cour...

VBA function changing name
OK, here's a strange one - well strange to me anyway. I've declared a function in a module using mixed case: Function TMDE_Category (FormName As Form) The function is called by the VBA code behind two different forms. I noticed the other day that it appeared in the module as Function tmde_category(FormName As Form) Obviously, this isn't preventing the database application from running, but I can't figure out why it changed. I changed it back to the mixed case declaration, saved the module, exited the app, reopened it and looked. The function had changed back t...

Office2004 crashes in VBA
Hi All I'm having a problem with my office 2004, it crashes when I forget to make a space infront of a ( in the VB editor. Office force quits, and tells me that it will recover my data, but it doesn't do so... I'm not that experienced with the VB editor, but it seems ti me that office should only give me a warning, and let me correct the mistake - or is it supposed to quit? Hope you can help me with a solution to this problem regards Hi Janus: It's not supposed to quit. I don't think the space is the problem. Show me the whole code module and I will have a better...

Create view to get data from multiple databases
I have 26 databases database, Database,......Database. I have a view as below that I want to modify so that it can get data from all 26 databases. I would appreciate some help on this. create view Unpostedallcompany as select cpnyid Periodpost, jrnltype, trantype,origcpnyid,acct,sub, perent,refnbr, trandate, trandesc,dramt, cramt from gltran order by cpnyid Thanks sunny > I have a view as below that I want to modify so that it can get data from > all 26 databases. I would appreciate some help on this. > > create view Unpostedallcompany as > select ...

Chart created in VB generates 2 additional meaningless series
After loading data into a worksheet I generate 3 separate charts on chartsheets. The first and third charts are generated as desired and the second chart looks okay but when I view the Source Data under Series I see that I have 2 additional series created. Series 1 references the named ranges for the X and Y values; Series 2 references a range of cells using range notation =B1:B100 for the Y Values with no X values defined; and Series 3 references Y Values of {1} with no X Values. The code I am using to create the chart and series is identical to that used for the other 2 charts as far as I c...

Link a textbox on a sheet to a cell?!
Hello, I've drawn a textbox on my spreadsheet. I want to link that textbox to the cell right below it. The reason for this is the text will be bigger in font that the row below. I already have a prefined print range. So by adding a textbox, my rows won't be made bigger. The textbox can be formatted to a barcode font. Question ====== I don't know how to link a textbox to a cell. I can do it in VBA on a userform. But on the spreadsheet, can a textbox be linked to a cell? Thanks, Tony to link it to cell A1 - select the textbox, click into the formula...

Excel VBA programmer needed
Programmer needed visual basic, in excel I own a bee removal company . I keep most my records and calcualtions in excel and I am looking for an excel specialist / vba programmer that can write code to simplify and speed up some of the time consuming tasks. Time is a factor for me, money is less of a factor. I imagine it would be around 80 hrs work. With probable future changes and or additions that would most likley arise. Example: Bee removal work can be divided into two parts, 1 exterminating a hive, and 2. removing the honey from the structure (from 5 to 300 lbs). The field rep exterm...

textbox in background PP 2007
how can I put a textbox (including bullets) at the backround as it appears non-active or less important ? Just responded to your later post. -- Echo [MS PPT MVP] http://www.echosvoice.com What's new in PPT 2010? http://www.echosvoice.com/2010.htm Fixing PowerPoint Annoyances http://tinyurl.com/36grcd PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/32a7nx "Roland" <Roland@discussions.microsoft.com> wrote in message news:F35EEEC4-E92F-4D04-A926-F4B8EFFEDFC3@microsoft.com... > how can I put a textbox (including bullets) at the backround as it ...

print preview and creating pdf of oversize design
When I create a design larger than standard paper size, the print preview is shown on multiple pages. When I create a pdf of the final design, it too is in multiple pages. Is there any way to do create a pdf of an oversized design without the page breaks? Is there also a way to do a print preview without the page separations? What PDF program are you using? You can setup custom pages in Acrobat, I am not sure about the other converters. When you are finished creating your publication, File, Print, reset everything on this screen. Page setup, orientation, the whole thing. There is a p...

Need to create a concordance file from an Excel Worksheet
Hi, I need to create an alphabetical index for a directory using a concordance file that is saved in an Excel Worksheet. Currently each row contains a column for "number" and "additional terms" fields. Below I have listed one example: number = 396809 additional terms = Mind-Body Interaction, Biopsychosoical Reserach, Children, Preoperative Interventions, Alternative Medicine, Hypnosis, Acupuncture, Adults, I need to transpose this excel file so that it appears as follows: number = 396809 additional terms = Mind-Body Interaction number = 396809 additional terms = Biopsyc...

Using mouse scroll wheel to create new records
I am finally working out the kinks in my DB. I have a button that creates a new record in a subform when the user selects it from a list in a main form. It keeps track of the main form id (which is stored in a variable on the subform as subpoenaID.) If i create a new form using this button, then my applications keeps track of the subpeonaID. BUT if I use the scroll when to create a new record, it loses track of the subpoenaID. (I don't allow this field to be blank so the user gets an error) I don't want to disable the mousewheel. Is there an easy way (or where is the control) for...

VBA Programming
I am reading a book on Excel 2003 VBA programming. It gives a short synopsis on how to set up the code for the workbook_open macro but doesn't really go into how to do it. Can anyone help me with this? I am using Excel 2007. I plan on writing the code on a Vista OS and implementing it in an XP environment. Thanks. R. Tanner You must place the code in the ThisWorkbook Module. Otherwise, what specifically did you need help with? --JP On May 27, 7:56 pm, tanner.ro...@gmail.com wrote: > I am reading a book on Excel 2003 VBA programming. It gives a short > synopsis on how to set ...

Excel 2003 VBA Editor Context Menu won't open on right-click
Somehow the context menu in the VBA Editor in Excel 2003 keeps "breaking". I had last fixed it by deleting my user profile and rebuilding it. That lasted a few days, and now it's not working again. What's going on? The only thing that's changed (as far as I know) is our IT department pushed down some updates for our mainframe access software over the weekend. Somehow I don't think that's the cause. Fortunately I can click the Context Menu button on the keyboard, but its a PITA to have lost this functionality. Has anyone seen this (and solved i...

how do i create a place to exchange opinions in outlook
I am new to outlook. I want to create a place (like a team-room in Lotus Notes application) where my collegues and I (as members of a team) can post our documents and experiences, and react upon another and so develop plans and strategies. This place should be available only to the team-members. How do I do this? "GEACUR 2008" <GEACUR 2008@discussions.microsoft.com> wrote in message news:706C24F4-459A-45FE-AA73-6A16BC41AF68@microsoft.com... >I am new to outlook. I want to create a place (like a team-room in Lotus > Notes application) where my collegues and I (as mem...

How to creat log scale chart?
I cannot creat a log scal chart. Any ideas on how to do? Rob: A logartithmic scale chart is not possible with all chart types, but for an XY chart it is, even for both X and Y-axes. Create your XY chart, right-click the axis you want to make logarithmic, choose Format Axis/Scale and check "Logarithmic scale". GL, Henk "Rob" wrote: > I cannot creat a log scal chart. Any ideas on how to do? ...