PDA

View Full Version : Solved: Open a Disclaimer first then the file in Word



klutz
10-11-2009, 08:26 AM
Hi,

I have a quote summary document in Word that I send out to clients. In that document I also have a disclaimer.

I would like for when the file is opened I want the disclaimer to be opened first, have the client accept the disclaimer and when accepted it opens the file. If it is not accept then the file will close.

Can this be done. Does any body know how to do this?

Klutz...

macropod
10-11-2009, 04:06 PM
Hi Klutz,

You could only do that with a macro but, if the user disables macros for just this document or globally via the security settings, the file will open anyway.

carrrnuttt
10-12-2009, 10:44 AM
Hi Klutz,

You could only do that with a macro but, if the user disables macros for just this document or globally via the security settings, the file will open anyway.

He could have the content be filled in by the macro itself, so when macros are disabled, the user just simply doesn't see anything.

macropod
10-12-2009, 01:26 PM
He could have the content be filled in by the macro itself, so when macros are disabled, the user just simply doesn't see anything.Hi carrrnuttt,

Yes, but for anything other than a simple document the code for this can become quite convoluted, especially once you start getting into tables and graphics.

klutz
10-12-2009, 02:15 PM
Hi Klutz,

You could only do that with a macro but, if the user disables macros for just this document or globally via the security settings, the file will open anyway.

A macro, which is what i do not know how to write.

I though it would be simple. I just wanted like a pop up to show the disclaimer words and have the user click ok before proceeding.

I just don't know how to do this. :dunno

macropod
10-12-2009, 03:13 PM
Hi Klutz,

Writing the macro isn't all that difficult, and we can helpyou with that. The real issue is whether you can rely on the macro for what you said you wanted to do. The gist of my post is that you can't.

carrrnuttt
10-12-2009, 03:25 PM
Hi carrrnuttt,

Yes, but for anything other than a simple document the code for this can become quite convoluted, especially once you start getting into tables and graphics.

I guess it just depends on how complicated the document in question is, and how much work would be "worth it" for the OP to do a project like this. He can use styles as well.

I think it's doable, and not particularly difficult [depending on the document's complexity], it just might be a tad tedious to actually work out.

klutz
10-12-2009, 03:30 PM
Sir Macropod,

Hmmm, i have a piece of code in excel file that i also send to customer. That code kinda warns the user that macro needs to be enabled. When they open the file a WARNING page appears telling them that the macro is disabled. This warning page then tells them how to enable the macro then they can open the file.

I can use that same piece of code in Word as well, right?

Here is my simple code in excel.

This code will show a warning page in user does not enable macro.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("Warning").Visible = True
Sheets("Summary Check").Visible = xlVeryHidden
End Sub



This code, after user enables macro, allows then to see the file.

Private Sub Workbook_Open()
Sheets("Warning").Visible = xlVeryHidden
Sheets("Summary Check").Visible = True
End Sub


Can something like this be done in Word as well?

Gracias,.......

Tinbendr
10-12-2009, 06:44 PM
Notwithstanding Macropod's excellent points, here's a example.

carrrnuttt
10-13-2009, 12:05 AM
Notwithstanding Macropod's excellent points, here's a example.

Good stuff. I'd just change the cancel event to this:


Private Sub cmdIDisagree_Click()
If Documents.Count = 1 Then
' Close word without saving
Application.Quit SaveChanges:=wdDoNotSaveChanges
Else
' Close document without saving
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
End If
End Sub

macropod
10-13-2009, 02:14 AM
Hmmm, i have a piece of code in excel file that i also send to customer. That code kinda warns the user that macro needs to be enabled. When they open the file a WARNING page appears telling them that the macro is disabled. This warning page then tells them how to enable the macro then they can open the file.

I can use that same piece of code in Word as well, right?
...
Can something like this be done in Word as well?
Hi Klutz,

From the code you posted, it is clear that the code, per se, doesn't warn the user of anything. The warning is via a 'Warning' worksheet that gets hidden if the macro runs, in which case a 'Summary Check' worksheet gets unhidden. Quite easily circumvented, BTW.

That code won't work in Word, because it's Excel-specific, so no you can't "use that same piece of code in Word". Likewise, Word has nothing equivalent to worksheets to hide and unhide, so no, "something like this" cant "be done in Word".

TonyJollans
10-13-2009, 02:47 AM
I have to back up macropod here. This cannot be done in Word - and even in Excel, the 'very hidden' sheet would stop neither him nor me.

Yes, it would be possible to present something that looked like you ask, but it would only act as a deterrent (through ignorance) against a subset of ordinary users, and would not carry any weight because it would be easy to demonstrate ways round it. You would be better off putting the disclaimer at the start of the document and wording it to say reading the document would be deemed acceptance of the conditions.

fumei
10-13-2009, 10:44 AM
I agree. Put your disclaimer at the start and word it as whatever seems (pretends) to be relevant. It is probably not technically/legally binding, but what the heck.

There are tricks to attempt to do this kind of "preview" conditional decisions, but none of them are of any real consequence for someone who knows what they are doing.

klutz
10-13-2009, 10:47 AM
Great Thank you Team.

I've added the disclaimer to the footer of the page with a pass protect.

This team has been enormoulsy helpful. Thank you againto everyone here..

Da Klutz----