|
-
Jun 7th, 2006, 09:56 PM
#1
Thread Starter
New Member
I get "Object variable or With block variable not set" error
I get the error described in the title when executing the code beneath. Any help would be appreciated.
VB Code:
Public Sub AutoNew()
Dim PlayName
PlayName = InputBox("Enter Name of Play", "Name of Play")
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.TypeText Text:=PlayName & vbTab & vbTab
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldPage
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
Port
-
Jun 8th, 2006, 09:58 AM
#2
Re: I get "Object variable or With block variable not set" error
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 8th, 2006, 11:44 AM
#3
Thread Starter
New Member
Re: I get "Object variable or With block variable not set" error
It does not provide a line number. I just get a message box that appears with the error message. i'm new to VBA and VB in general, but am an experienced programmer in other languages.
Is there a way to get a more detailed message?
Port
-
Jun 8th, 2006, 12:00 PM
#4
Re: I get "Object variable or With block variable not set" error
it wont provide line numbers.. but it should highlight the line showing the error.
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|