473,324 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Launching MS/Word from VBA

Greetings. I have a command button that, when clicked, opens up an
instance of MS/Word and opens a document (the filename is the input
argument to the function that is kicked off"). This works fine.

My question is ...

Is it possible to open up Word with 'print view' on? Currently, the
document opens up in 'normal view' and it really looks much better in
'print view'.

Any suggestions?
Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #1
3 2271
You'd need to use Automation, and change View.Type = wdPrintView

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Susan Bricker" <sl*****@verizon.net> wrote in message
news:mW*************@news.uswest.net...
Greetings. I have a command button that, when clicked, opens up an
instance of MS/Word and opens a document (the filename is the input
argument to the function that is kicked off"). This works fine.

My question is ...

Is it possible to open up Word with 'print view' on? Currently, the
document opens up in 'normal view' and it really looks much better in
'print view'.

Any suggestions?
Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***

Nov 13 '05 #2
Douglas,

Thanks for the help. I have to admit, that I using some code "culled"
from the Internet from Albert D. Kallal (public source code). So, I
don't fully understand the logic. I see where an instance of Word App
is defined, as is the Word Doc. I see where the application is opened
and activated. So, I just used the same syntax scheme to put what you
suggested inline. It didn't work.

I put ...

wordApp.view.Type = wdPrintView

But ...
the constant wdPrintView is not defined anywhere. I started guessing at
the values and plugging it in but it didn't change the view of the
document.

I'm, also, not certain that

wordApp.view.Type

is correct.

So, if you can offer any more insight that would be great. In the
meantime, I am scanning around for some examples or help.

Oh ... I went back to the Word window and what I want is 'Print Layout'.

Thanks.
SueB

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #3
I know Albert's code, but I don't have it handy. Does it use Late Binding,
or Early Binding (i.e.: do you have to set a reference to Word or not)? I'd
guess Late Binding (so that it's more universally useful), in which case
Access has no way of knowing what the value is for wdPrintView. What you
have to do in that situation is go into Word, and determine what the value
is for that constant (it's 3)

The View object is actually contained within the Window object, which should
be contained in the Document object. Therefore, assuming the Word Document
object is named wordDoc, try:

wordDoc.Window.View.Type = 3

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Susan Bricker" <sl*****@verizon.net> wrote in message
news:_X**************@news.uswest.net...
Douglas,

Thanks for the help. I have to admit, that I using some code "culled"
from the Internet from Albert D. Kallal (public source code). So, I
don't fully understand the logic. I see where an instance of Word App
is defined, as is the Word Doc. I see where the application is opened
and activated. So, I just used the same syntax scheme to put what you
suggested inline. It didn't work.

I put ...

wordApp.view.Type = wdPrintView

But ...
the constant wdPrintView is not defined anywhere. I started guessing at
the values and plugging it in but it didn't change the view of the
document.

I'm, also, not certain that

wordApp.view.Type

is correct.

So, if you can offer any more insight that would be great. In the
meantime, I am scanning around for some examples or help.

Oh ... I went back to the Word window and what I want is 'Print Layout'.

Thanks.
SueB

Regards,
SueB

*** Sent via Developersdex http://www.developersdex.com ***

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: James Grant | last post by:
I have an app that launches MSWord for a report sequence. Some installs have word open and minimzed on the task bar. Some installs have word maximized on screen. Is there a way I can force it (my...
2
by: Jason Steeves | last post by:
Can someone post the needed code that will allow me to launch word on the client PC and have the filename specified as a variable. I have been working on this and can't find any clear documentation...
1
by: David | last post by:
Hello. I've written a page for an intranet that gives the user the option of launching a Word or PowerPoint document. The code I used to force the hyperlink to launch the application rather...
4
by: Danny | last post by:
Hello again I have two quesitons about launching IE from code in access. Is there a way to do the shell command to launch IE without having to know the exact path. shell seems to be picky and...
3
by: Waldy | last post by:
Hi there, I have followed the steps in the MS article 288367 to enable Word to run from a web page. I have done this several times and it has worked OK. However, at a customer site I am getting...
0
by: Sheila | last post by:
I have set up a Word mail merge document of the type Directory which allows me to display all of the records on a single page rather than putting each record on a separate page. It uses a...
5
by: Bob | last post by:
I'm getting error 8007007e when executing the following code. Dim word As New Microsoft.Office.Interop.Word.Application Dim doc As Microsoft.Office.Interop.Word.Document doc =...
1
by: =?Utf-8?B?TWFyayBIb2xsYW5kZXI=?= | last post by:
Hi All, I am trying to launch an application based on the extension just like windows explorer does, specifically with regards to templates. For example, 1. When you double click on a word...
0
by: SteelNetNob | last post by:
I am having a problem where I have a COM application that can be run stand-alone and programatically via COM interop. If an instance of the COM application is being run when my .NET application that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.