Solved

WordBasic Object Commands

Posted on 1997-04-30
4
300 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

751 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