Object reference not set to an instance of an object-URGENT

Hi @kumar.varun2 @GreenTea @Srini84

Pls help on this case…!!!

Under assign activity:-

To : strPdfExtract
Value(in argument): mailItemoutlook.Body.ToString


Object reference error will occur if you are assign any null value

check that you are not passing any null values also check If you are passing arguments correctly

Also check if you are creating the same variables and arguments that would be confusing also

Hope this may help you


Hi @mitul_choudhary ,

The argument that you are passing from another workflow is not assigned with the value object (System.Net.Mail.MailMessages)

Can you share screenshot from where you are passing the value of mailItemoutlook?

Hope u mean this.!!

1 Like

In the default section please enter the value as new MailItem

is it fine…?

1 Like

Yeah, please proceed.

Reach out if you still face issues.

Hi @mitul_choudhary ,

Use below variable type.

but showing compiler error

1 Like

Could you please show the error ?

do i need to mention something in default value…?

not needed if you are passing some mail object to it.

1 Like

Add assign inside an if block…

Condition should be - mailItemOutlook <> nothing

In the then part add assign / In the else part throw your own error that mail not found or something.


Still i am not clear from where to where you are passing mail object.
Is this mail object is on the same page or you are passing it from previous workflow?

If you are passing it from mail to drive page show me the invoke workflow and it’s arguments.
An second how you are lopping this whole mail part i want to see that logic also.


@ermanoj3101 @Nithinkrishna
nowi’m bit confuse what should i do first…?

Let’s do step by step

1 - Show be where you are reading all mails
2 - How you are iterating mails (example - from foreach loop or from counter ) ?
3 - I want to see where you are invoking drive xaml and what are the arguments ?

Hi @mitul_choudhary

Why is there a comment out activity above the assign activity? Is it intentionally or unintentionally ?

This error i got while entering new MailItem in default section.

1 Like

Please modify it to new Microsoft.Office.Interop.Outlook.MailItem