Page 1 of 1

How to remove attachments in outlook

Posted: Tue Nov 28, 2017 6:47 pm
by Simran
Hi,

I want to remove attachments from outlook. the code I used is:

Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Click item 'textInfo' at 270;6.", textInfo);
textInfo.FindAdapter<Text>().Click("270;6");
Report.Log(ReportLevel.Info, "Keyboard", "Key sequence '{Back}' with focus on 'textInfo'.", textInfo);
textInfo.FindAdapter<Text>().PressKeys("{Back}");[/b
]

I am using outlook 2010 and ranorex 7.2.0. This code was working before this work when attachments are displaying like a taskbar. but when display change for attachments this code get failed. Even different versions of outlook can create problems. So I want to know any efficient way or code for removing attachments from mail that doesn't matter with the position of attachments.

thanks

Re: How to remove attachments in outlook

Posted: Tue Nov 28, 2017 10:04 pm
by Vega
Why don't you just record yourself removing the attachments and then look at the code Ranorex generated for those steps? This would be the easiest way in my opinion:

Record yourself removing attachments -> Right click the steps that were created during the recording -> chose view code OR convert to code from the right-click context menu. This way you let Ranorex do the hard work and you can just adjust the code as needed if at all.

Hope this helps!