Hey guys, i am new to VBA and having a blast using macros and such. I managed to teach myself some basic word/excel manipulations but i am encountering weird occurings when it comes to outlook. So after a short introduction i will present my questions:

1) When i try a code in an outlook form and publish it (i am not sure if those are the right words, since my office is in hebrew) i keep on getting "expected end of statement", even when i just copy-paste something from the office help.

example:

[VBA]Sub HidePage()
Dim myOlApp As New Outlook.Application
Dim MyItem As Outlook.ContactItem
Dim myPages As Outlook.Pages
Dim myinspector As Outlook.Inspector
Set MyItem = myOlApp.CreateItem(olContactItem)
Set myPages = MyItem.GetInspector.ModifiedFormPages
myPages.Add "General"
Set myinspector = myOlApp.ActiveInspector
myinspector.HideFormPage "General"
MyItem.Display
End Sub[/VBA]


2) Is it possible to make an outlook form that contains attachments that can not be opened unless you click a certain command button? The main goal is for that command button to send a reply to someone in particular. I managed to create such a thing in Word persay (locked the documents and the user had to click a command button to enable modifying and by such an auto email messege was sent).


Any help will be appriciated


mbm