Giter Club home page Giter Club logo

Comments (9)

nmonkee avatar nmonkee commented on May 26, 2024

Line 179 contains this:

$Word.DisplayAlerts = $False

Outside of the version check loop when modifying an existing doc.

Perhaps the issue?

from nishang.

nmonkee avatar nmonkee commented on May 26, 2024

Fixing that, you then get another error...

Argument: '2' should be a System.Management.Automation.PSReference. Use [ref].
At C:\Out-Word.ps1:292 char:17

  •             $Doc.Saveas([ref]$SavePath, 0)
    
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodException
    • FullyQualifiedErrorId : NonRefArgumentToRefParameterMsg

from nishang.

nmonkee avatar nmonkee commented on May 26, 2024

This seems to make it all play nice:

            $SaveFormat = “microsoft.office.interop.word.WdSaveFormat” -as [type]
            $Doc.Saveas([ref]$SavePath, [ref]$SaveFormat::wdFormatDocumentDefault)

from nishang.

nmonkee avatar nmonkee commented on May 26, 2024

Probably want [ref]0 or the Macro doesn't get embedded.

from nishang.

samratashok avatar samratashok commented on May 26, 2024

Thanks for the fix! Let me test this.

from nishang.

hardrock1234 avatar hardrock1234 commented on May 26, 2024

It works like charm on windows 7 with office 2013 - or maybe it's to do with AMSI ?

Regards,

from nishang.

samratashok avatar samratashok commented on May 26, 2024

Try it with a simple payload (like Get-Process), if the same error persists, its AMSI. Though I don't think it is AMSI. I will test it tomorrow and fix this issue.

from nishang.

hardrock1234 avatar hardrock1234 commented on May 26, 2024

Cool, trying now and keep you posted,

Regards

from nishang.

samratashok avatar samratashok commented on May 26, 2024

Closing this as no further information was provided.

from nishang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.