Ola Boa Noite, estou tentando cancelar um MDFe, seguindo o exemplo que vem no ACBRMDFe, e esta me retornando a mensagem, apos colocar a Justificativa:
"Argument out of range."
segue o meu codigo abaixo.:
if not(InputQuery('WebServices Cancelamento', 'Justificativa', vAux))
then exit;
MDFeMy.EventoMDFe.Evento.Clear;
with MDFeMy.EventoMDFe.Evento.Add do
begin
infEvento.chMDFe := Copy(MDFeMy.Manifestos.Items[0].MDFe.infMDFe.ID, 5, 44);
infEvento.CNPJ := frmmodulo.qremitenteCNPJ.AsString;
infEvento.dhEvento := now;
// TpcnTpEvento = (teCCe, teCancelamento, teManifDestConfirmacao, teManifDestCiencia,
// teManifDestDesconhecimento, teManifDestOperNaoRealizada,
// teEncerramento);
infEvento.tpEvento := teCancelamento;
infEvento.nSeqEvento := 1;
infEvento.detEvento.nProt := MDFeMy.Manifestos.Items[0].MDFe.procMDFe.nProt;
infEvento.detEvento.xJust := trim(vAux);
end;