Solved

Visual Basic/Word Question

Posted on 2000-03-16
14
188 Views
Last Modified: 2013-11-25
I don't even know if this is possible but it sure would be nice if it was.
I want to place a statement at the top of the form to automatically set each line in a word document up to a certain amount of spaces and automatically set up where pages are and such so I can insert things on a coordinate basis.  Is this possible in Word VB?

rick
0
Comment
Question by:saksafon2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 5
14 Comments
 
LVL 4

Expert Comment

by:wesleystewart
ID: 2623898
Welcome back!!

You will find that EVERYTHING is possible if you take the time to figure out how to get it to work.  Of course, the value you add by coding some process might not offset the 100 hours you put into it, but that's for you to decide.

Can you describe in more detail what you're trying to accomplish?

Wes
0
 

Author Comment

by:saksafon2
ID: 2623972
I'm back, I'm back.  *takes a bow*

I want to be able to look VB in the eye and say, "Hey, put this line of text on line 40, column 30."
I want it to go there.  I want to be able to say "Go to line 62 and place a section break."  I can put a "selection.movedown unit:=wdline, count:=62" but because there are not <CR>'s all the way down the page it doesn't go anywhere except to the end.  

MEH.

rick
0
 

Author Comment

by:saksafon2
ID: 2623983
I'm back, I'm back.  *takes a bow*

I want to be able to look VB in the eye and say, "Hey, put this line of text on line 40, column 30."
I want it to go there.  I want to be able to say "Go to line 62 and place a section break."  I can put a "selection.movedown unit:=wdline, count:=62" but because there are not <CR>'s all the way down the page it doesn't go anywhere except to the end.  

MEH.

rick
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Expert Comment

by:wesleystewart
ID: 2624061
Is this something you can accomplish by creating a new template full of carriage returns and then using it to create new documents?

If you need to do the same task over and over, you might just want to create a document, put the text in the funny places, and then save it a a template (.dot) so you can use it again and again.

Or, on opening the document you could execut a line of code like:

Document.Body = Space(1000) which will give you 1000 spaces.  That ought to be worth a few pages.

We can figure out how to accomplish whatever it is, but it might be complicated.

Wes
0
 

Author Comment

by:saksafon2
ID: 2624089
That space sounds good.. is there a way to select one line?  Say "selection.goto.line(32)"?
That'd be nice but it doesn't work.
0
 
LVL 4

Expert Comment

by:wesleystewart
ID: 2624231
That would be:

Selection.MoveDown unit:=wdline, count:=32

to move the selection start point to the beginning of line 32.  Then:

Selection.MoveEnd Unit:=wdLine, Count:=1

would move the selection end point to the end of the line, effectively selecting the entire line.

Wes
0
 

Author Comment

by:saksafon2
ID: 2624378
What if I want to move the cursor to line 32 and there are only 20 lines on the document done already?  It'll stop on 20 and stay there.. it won't create the rest..

rick
0
 

Author Comment

by:saksafon2
ID: 2624380
What if I want to move the cursor to line 32 and there are only 20 lines on the document done already?  It'll stop on 20 and stay there.. it won't create the rest..

rick
0
 

Author Comment

by:saksafon2
ID: 2624382
What if I want to move the cursor to line 32 and there are only 20 lines on the document done already?  It'll stop on 20 and stay there.. it won't create the rest..

rick
0
 

Author Comment

by:saksafon2
ID: 2624385
What if I want to move the cursor to line 32 and there are only 20 lines on the document done already?  It'll stop on 20 and stay there.. it won't create the rest..

rick
0
 
LVL 4

Expert Comment

by:wesleystewart
ID: 2624449
you might want to stop hitting Refresh on your browser . . .  Use the 'reload question' near the top-right corner of the EE page.

You'll have to make sure your document already has those lines.  Use a template:

Take a blank document.  Add a lot of space to it, maybe by hitting <Enter> about a thousand times.  Save this document with a '.dot' suffix.  That makes it a template.  When you need to create one of your "special" documents, open a new document based on this template.  It will have pages and pages of space for you to work with.  The problem with this approach is that while you edit the document you will be adding and subtracting characters. which will throw off your spacing, but you'll have to find a way around that.

What, may I ask, is your application?  You might be better off with a forms-generation package or by just using userforms rather than documents.  They are printable and everything will appear right where you want it.  Maybe Msoft Publisher would be a better piece of software for you . . .

Wes
0
 

Author Comment

by:saksafon2
ID: 2624731
I'm not hitting refresh at all; whats happening is the system is stopping connection and forcing me to hit submit again.  I'm on a slow slow connection.  I'm working at the Third Judicial Circuit Court of Detroit as a temporary right now doing typing and now, for the first time in a long time, programming to make the development of reports and informational sheets much much quicker than doing it by hand.  I never thought of looking into Publisher;  I don't have it on this system but maybe I could acquire it.  It's not really a form--the file is more of a document, but I need certain things in certain places.  Hm!  Maybe I'll take a look into publisher if I can get it loaded up on this system.  I'm assuming Publisher has a built in VB as well?

-rick
0
 
LVL 4

Accepted Solution

by:
wesleystewart earned 5 total points
ID: 2624776
I think so.  VBA keeps popping up everywhere-powerpoint, visio, autocad . . .

Wes
0
 

Author Comment

by:saksafon2
ID: 2625114
Meh.  Exciting.

rick
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Suggested Courses
Course of the Month5 days, 11 hours left to enroll

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question