Solved

WordBasic Object Commands

Posted on 1997-04-30
4
276 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
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:tward
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Okay -- thanks for the help -- I guess I will try that
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now