Code for launching attachment- Properties window from backend poping up-

Hello,

I m putting following code into my form declaration event :

Type KBDINPUT ’ INPUT structure

wVk As Integer ' must be 1 for kbd

wScan As Integer ' VKey code

dwFlags As Long ' we don't use this

iTime As Long ' don't use this

dwExtraInfo As Long ' or this

End Type

Dim Kinput As KBDINPUT

Type GeneralInput

dwType As Long

xi(0 To 23) As Byte

End Type

Dim Ginput(0 To 1) As GeneralInput

Const INPUT_KYBOARD = 1

Const KEYEVENTF_KEYUP = &H2

Const VK_CONTROL = &H11

Const VK_MENU = &H12 ’ the ALT key

Const VK_T = &H54

Const VK_TAB = &H09

Const VK_RETURN = &H0D

Declare Sub keybd_event Lib “user32” (Byval bVk As Byte, Byval bScan As Byte, Byval dwFlags As Long, Byval dwExtraInfo As Long)

Forms" PostOpen event ;

Sub Postopen(Source As Notesuidocument)

Call source.GotoField("Attachment")

Call source.SelectAll



Call keybd_event(VK_MENU,0,0,0) ' press the ALT key

Call keybd_event(VK_T,0,0,0) ' fire the T key

Call keybd_event(VK_T,0,KEYEVENTF_KEYUP,0) ' let up the T key

Call keybd_event(VK_MENU,0,KEYEVENTF_KEYUP,0) ' let up the ALT key



Call keybd_event(VK_RETURN,0,0,0) ' fire the RETURN key

Call keybd_event(VK_RETURN,0,KEYEVENTF_KEYUP,0) ' let up the RETURN key



Call keybd_event(VK_TAB,0,0,0) ' fire the TAB key

Call keybd_event(VK_TAB,0,KEYEVENTF_KEYUP,0) ' let up the TAB key

Call keybd_event(VK_TAB,0,0,0) ' fire the TAB key

Call keybd_event(VK_TAB,0,KEYEVENTF_KEYUP,0) ' let up the TAB key



Call keybd_event(VK_RETURN,0,0,0) ' fire the RETURN key

Call keybd_event(VK_RETURN,0,KEYEVENTF_KEYUP,0) ' let up the RETURN key

End Sub

Now it works good, it is openning the word attachment automatically (launching), but the propertie widow for attachment remains opens.

Could anybody please help me comeout this!!!

As i also want to check that if the Ms word should be closed at the event of closing the current opened document.

Please help me come out this problem

!! anybody more frequently come with this kind of issue!!!

you can drop me a mail at chauhan.devsur@gmail.com

Dev

Subject: Code for launching attachment- Properties window from backend poping up-

And just what, exactly, is wrong with the form launch setting that several people pointed you to already? Is it just stubbornness that is keeping you from using it?

Subject: RE: Code for launching attachment- Properties window from backend poping up-

Yes, Roger

I know that, but the thing is that my word/excel should be stored as keyword document, and i am retriving them from agent!!!

Please try to help !!!

Dev