Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.Visible property for MS Publisher document using vbscripting

Status
Not open for further replies.

Flying Chips

Technical User
Jan 25, 2019
1
IN
Hello people,

I have small query while working with MS Publisher document. Visible property isn't working. Here is my simple code.
Set ObjPbl = CreateObject("Publisher.Application")
ObjPbl.Visible = True
Set objApp = ObjPbl.Open ("C:\PubFiles\pubint.pub")
WScript.Sleep (5000)
ObjPbl.Quit

Getting following error."object doesn't support this property or method: objPbl.visible".

I tried the other way of doing it.
Set objShell = WScript.CreateObject("WScript.Shell")
intReturn = objShell.Run ("C:\PubFiles\pubint.pub")
WScript.Sleep (5000) ' wait doc to open
objShell.Run "taskkill /im mspub.exe"

In this I am able see pub document opening the file but sleep function isn't working in this case. It is just launching the document and immediately process is getting killed

Appreciate your help in resolving this. Thanks in advance.
 
I have no publisher, but, from the object model in ms docs, I would try [tt]ObjPbl.ActiveWindow.Visible = True[/tt]

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top