OnLineView of active document 
Author Message
 OnLineView of active document

It seems to work fine if you use
Application.ActiveWindow.View.Type = wdOnlineView
instead of just

It also seems to work fine (without Application.)
if you move the macro to a standard module instead
of leaving it in the class module ThisDocument.

I don't know enough about class modules in general
and ThisDocument in particular to say whether this
is just an anomaly or whether it is regular behavior
for that environment...

> I'm trying to write a piece of code that changes the view of the
> document to OnLineView.
> The code below works fine if it is run from it's own document.

> If I save the document in which the macro exists as a template and
make it
> available to Word through the menu "Extra / Templates and add-ins", I
get an
> error which is in dutch:
> Fout '91' tijdens uitvoering:
> Objectvariabele of blokvariabele With is niet ingesteld.

> I try to translate this in english:
> Error '91' on execution:
> Objectvariable or blockvariable With not set.

> Below follows the code:

> Sub OnLineView()
>     If Documents.Count > 0 Then
>         ActiveWindow.View.Type = wdOnlineView
>     end if
> End Sub

> Any suggestions ?

> Marcel

Sat, 01 Mar 2003 04:21:22 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Macro to insert text or document into active document

2. OnLineView

3. Adding a Document to the active contact

4. Active Document behaviour

5. Save As with Active Document Name +1

6. Maintaining Active Document Between Userforms

7. active documents

8. Counting the pages in an active document

9. check active document

10. rename active document

11. Protect Control in Active Document

12. Determine Range within Active Document


Powered by phpBB® Forum Software