Solved

WordBasic Object Commands

Posted on 1997-04-30
4
303 Views
Last Modified: 2012-06-21
I have an object declared as a Word.Basic type.  I send text from my VB app to it and need to print it.  Before I print it, however I need to change the printer orientation to Landscape.  How do I do this?
(ie, if my object name is WordLanguage, I know that the executing WordLanguage.InsertPageBreak inserts a page break, and WordLanguage.Font "Courier" sets the font type to Courier, but what property do i have to access to set (or return) the printer orientation?)
0
Comment
Question by:Loiosh
[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
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:tward
ID: 1425859
Try:

 WordLanguage.FilePageSetup.Orientation=0 ' Portrait
 WordLanguage.FilePageSetup.Orientation=1 ' Landscape

You can also try:

 WordLanguage.TogglePortrait  

from what I have read TogglePortrait will toggle between Landscape and Portrait...

Hope this helps.
0
 

Author Comment

by:Loiosh
ID: 1425860
I hate to say it, but it doesn't work.  When I try WordLanguage.FilePageSetup.Orientation = 1, I get a run-time error 424 (object required) and while WordLanguage.TogglePortrait , does cause it to change to from one mode to the other -- that doesn't help me if the printer was already in Landscape mode (there doesn't seem to be a way to check the printers original orientation.)
0
 
LVL 7

Accepted Solution

by:
tward earned 50 total points
ID: 1425861
The only way to change to orientation then would be to set it up as a macro and then run the macro from visual basic.
0
 

Author Comment

by:Loiosh
ID: 1425862
Okay -- thanks for the help -- I guess I will try that
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month7 days, 13 hours left to enroll

632 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