Permission Denied

Status
Not open for further replies.
U

UGllcnJlIFNjZXJyaQ

I am using a form in Outlook 2003 that has 3 option buttons.

Button 1 changes the view to Calendar. Buttons 2 and 3 switch to 1 of 2

folders in 'Notes'. Each of the 2 folders in 'Notes' points to a different

website.

Button 2 is the default. If i switch using Button 3 and back to Button 2

all is well. If i switch using button 1 (calendar view) and back to button 2,

i get a permission denied error. The code that is activated when i click

buton 2 is:

Private Sub OptCWP_Click()

If MyFolder Is Nothing Then Set MyFolder =

Application.GetNamespace("MAPI").GetDefaultFolder(olFolderNotes).Folders("Crew Web Portal")

With Application.ActiveExplorer

Set .CurrentFolder = MyFolder

Do While .HTMLDocument.readyState <> "complete": DoEvents: Loop

If InStr(1, .HTMLDocument.Location, "CWPLogin") Then...

The code stops at this line with the permission denied error. Clicking past

the error and pressing F5, execution continues normally.

I suspect that the webpage hasn't fully loaded even if i've put a loop to

wait for it. Is this the correct way to wait for the page to load?

Thank you

PS Can i access the HTNL contents of a folder that points to a webpage using

Getexplorer without actually displaying the folder in a separate window?
 
If you set the WebViewURL property of the MAPIFolder object for one of those

Notes subfolders you can just read that property from the MAPIFolder object

without involving an Explorer at all.

I'm unclear however what you want to happen. Do you want those Notes folders

with Web pages to actually be displayed and show the Web site? If so then

you do need the Explorer and you need to make the folder the CurrentFolder.

If you want to show the Web site in a separate window you can use automation

to open an IE window and navigate to the Web site that way.

Does the correct Web site show up when you select one of those Notes folders

in the user interface, without code? No errors that way?

Is there any difference in coding between buttons 2 and 3? What happens if

you go from button 1 to button 3? Any errors then?

"Pierre Scerri" <PierreScerri> wrote in message

news:535E7C18-E948-4750-A9C6-C07E68874973@microsoft.com...
> I am using a form in Outlook 2003 that has 3 option buttons.
> Button 1 changes the view to Calendar. Buttons 2 and 3 switch to 1 of 2
> folders in 'Notes'. Each of the 2 folders in 'Notes' points to a
> different
> website.
> Button 2 is the default. If i switch using Button 3 and back to Button 2
> all is well. If i switch using button 1 (calendar view) and back to button
> 2,
> i get a permission denied error. The code that is activated when i click
> buton 2 is:
> Private Sub OptCWP_Click()
> If MyFolder Is Nothing Then Set MyFolder =
> Application.GetNamespace("MAPI").GetDefaultFolder(olFolderNotes).Folders("Crew
> Web Portal")
> With Application.ActiveExplorer
> Set .CurrentFolder = MyFolder
> Do While .HTMLDocument.readyState <> "complete": DoEvents: Loop
> If InStr(1, .HTMLDocument.Location, "CWPLogin") Then...

> The code stops at this line with the permission denied error. Clicking
> past
> the error and pressing F5, execution continues normally.

> I suspect that the webpage hasn't fully loaded even if i've put a loop to
> wait for it. Is this the correct way to wait for the page to load?

> Thank you

> PS Can i access the HTNL contents of a folder that points to a webpage
> using
> Getexplorer without actually displaying the folder in a separate window?
 
Thank you for your reply.

I was initially using IE for this. That stopped when i found out i could

use outlook itself as a browser.

The web page involved is a login page. I can programmatically input

username and password and click the login button on the page without

problems.

I then need to make sure that the login has been successful by checking the

> .HTMLdocument.location to see whether it contains the word 'CWPLogin' in its

address.

If it does then login failed and i have to try again otherwise login is ok

and i can continue.

Looking at the Webviewurl does not help.

The correct website shows up - no problem there.

I do not really need to show the webpage at all come to think of it. Can i

still manipulate the data in that webpage if it is not visible? When i say

manipulate i mean that the webpage contains time data that i need to retreive

and use to set appointments (this is part is already working well)

The problem is that i need a delay loop to wait for the webpage to load

completly before doing anyrhing else, and i keep getting the permission

denied error.

I have since tried making the folder as a subfolder of 'Calendar'. Same

error.

I also dispensed with the idea of a subfolder and set the Webviewurl in

Calendar properties. Same error.

Can't think of a way out. Yet
wrote:


> If you set the WebViewURL property of the MAPIFolder object for one of those
> Notes subfolders you can just read that property from the MAPIFolder object
> without involving an Explorer at all.

> I'm unclear however what you want to happen. Do you want those Notes folders
> with Web pages to actually be displayed and show the Web site? If so then
> you do need the Explorer and you need to make the folder the CurrentFolder.
> If you want to show the Web site in a separate window you can use automation
> to open an IE window and navigate to the Web site that way.

> Does the correct Web site show up when you select one of those Notes folders
> in the user interface, without code? No errors that way?

> Is there any difference in coding between buttons 2 and 3? What happens if
> you go from button 1 to button 3? Any errors then?

> >

>

> "Pierre Scerri" <PierreScerri> wrote in message
> news:535E7C18-E948-4750-A9C6-C07E68874973@microsoft.com...
> >I am using a form in Outlook 2003 that has 3 option buttons.
> > Button 1 changes the view to Calendar. Buttons 2 and 3 switch to 1 of 2
> > folders in 'Notes'. Each of the 2 folders in 'Notes' points to a
> > different
> > website.
> > Button 2 is the default. If i switch using Button 3 and back to Button 2
> > all is well. If i switch using button 1 (calendar view) and back to button
> > 2,
> > i get a permission denied error. The code that is activated when i click
> > buton 2 is:
> > Private Sub OptCWP_Click()
> > If MyFolder Is Nothing Then Set MyFolder =
> > Application.GetNamespace("MAPI").GetDefaultFolder(olFolderNotes).Folders("Crew
> > Web Portal")
> > With Application.ActiveExplorer
> > Set .CurrentFolder = MyFolder
> > Do While .HTMLDocument.readyState <> "complete": DoEvents: Loop
> > If InStr(1, .HTMLDocument.Location, "CWPLogin") Then...
> > The code stops at this line with the permission denied error. Clicking
> > past
> > the error and pressing F5, execution continues normally.
> > I suspect that the webpage hasn't fully loaded even if i've put a loop to
> > wait for it. Is this the correct way to wait for the page to load?
> > Thank you
> > PS Can i access the HTNL contents of a folder that points to a webpage
> > using
> > Getexplorer without actually displaying the folder in a separate window?


>
 
In cases like that I use IE, don't show the IE window, and avoid using

Outlook as a Web browser entirely.

"Pierre Scerri" <PierreScerri> wrote in message

news:48DCBF26-DC91-4E81-B495-CD9FC42DC2C3@microsoft.com...
> Thank you for your reply.

> I was initially using IE for this. That stopped when i found out i could
> use outlook itself as a browser.

> The web page involved is a login page. I can programmatically input
> username and password and click the login button on the page without
> problems.

> I then need to make sure that the login has been successful by checking
> the
> .HTMLdocument.location to see whether it contains the word 'CWPLogin' in
> its
> address.

> If it does then login failed and i have to try again otherwise login is ok
> and i can continue.

> Looking at the Webviewurl does not help.

> The correct website shows up - no problem there.

> I do not really need to show the webpage at all come to think of it. Can
> i
> still manipulate the data in that webpage if it is not visible? When i
> say
> manipulate i mean that the webpage contains time data that i need to
> retreive
> and use to set appointments (this is part is already working well)

> The problem is that i need a delay loop to wait for the webpage to load
> completly before doing anyrhing else, and i keep getting the permission
> denied error.

> I have since tried making the folder as a subfolder of 'Calendar'. Same
> error.
> I also dispensed with the idea of a subfolder and set the Webviewurl in
> Calendar properties. Same error.

> Can't think of a way out. Yet
 
Thanks for the feedback. However i feel that using IE does not solve the

problem. It avoids it. Furthermore if i use the same code on a Vista

machine, the code fails as Vista seems to launch IE in 2 pieces.

Using Outlook as the browser would probably avoid that.

Also all the code is working except that the delay loop that waits for the

page to load is not doing what i would like it to do. As i said before,

resuming execution after the 'Permission Denied' error, the code works.

Anyway. Once again for your input
wrote:


> In cases like that I use IE, don't show the IE window, and avoid using
> Outlook as a Web browser entirely.

> >

>

> "Pierre Scerri" <PierreScerri> wrote in message
> news:48DCBF26-DC91-4E81-B495-CD9FC42DC2C3@microsoft.com...
> > Thank you for your reply.
> > I was initially using IE for this. That stopped when i found out i could
> > use outlook itself as a browser.
> > The web page involved is a login page. I can programmatically input
> > username and password and click the login button on the page without
> > problems.
> > I then need to make sure that the login has been successful by checking
> > the
> > .HTMLdocument.location to see whether it contains the word 'CWPLogin' in
> > its
> > address.
> > If it does then login failed and i have to try again otherwise login is ok
> > and i can continue.
> > Looking at the Webviewurl does not help.
> > The correct website shows up - no problem there.
> > I do not really need to show the webpage at all come to think of it. Can
> > i
> > still manipulate the data in that webpage if it is not visible? When i
> > say
> > manipulate i mean that the webpage contains time data that i need to
> > retreive
> > and use to set appointments (this is part is already working well)
> > The problem is that i need a delay loop to wait for the webpage to load
> > completly before doing anyrhing else, and i keep getting the permission
> > denied error.
> > I have since tried making the folder as a subfolder of 'Calendar'. Same
> > error.
> > I also dispensed with the idea of a subfolder and set the Webviewurl in
> > Calendar properties. Same error.
> > Can't think of a way out. Yet


>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
C Update Permission Denied BCM (Business Contact Manager) 5
O Cannot expand the folder. The set of folders cannot be opened. You do not have permission to log on. Using Outlook 1
V Report Permission Exchange Server Administration 1
W error with the permission for the file Outlook VBA and Custom Forms 0
E you don't have permission to perform this action exchange 2016 Exchange Server Administration 0
B No permission to access Outlook.pst file Using Outlook 1
C Permission in BCM BCM (Business Contact Manager) 6
I List View Permission Using Outlook 0
M Don't have permission to schedule meetings on behalf Using Outlook 1
B Notice to user of appt. set by person with permission to edit (Outlook 2003) Using Outlook 7
C error message: 'you don't have permission to create an entry in this folder' Using Outlook 3
D Send As Permission failing Exchange Server Administration 7
W Outlook 365 File access denied attempting to import .pst Using Outlook 6
Cdub27 Your changes to this item couldn't be saved because Server Denied Operation (HTTP 403 Forbidden) Using Outlook 1
P I am getting an error msg = cannot open file access denied Using Outlook 3
V Relay Access Denied message Using Outlook 1
Forum Admin Hotmail/MSN access is forbidden or denied Using Outlook.com accounts in Outlook 0

Similar threads

Back
Top