Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8694589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:49:10+00:00 2026-06-13T00:49:10+00:00

I am using PHP to call/manipulate a Word document, using COM. One of the

  • 0

I am using PHP to call/manipulate a Word document, using COM. One of the things I am doing is a SaveAs to text format. Because I am manipulating many Word documents, I don’t want the document to show up in the recent files list.

The VBA SaveAs function has an optional parameter to accomplish this, but I am wondering, is there a way to pass named arguments to the COM object, similar to what you can do in VBA?

For example, in Word, I could write:

ActiveDocument.SaveAs(Filename:='mynewfilename.doc', FileFormat:=2, AddToRecentFiles:=False)

Is there a way to do this in PHP using the COM object?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:49:11+00:00Added an answer on June 13, 2026 at 12:49 am

    Since PHP does not understand the concept of named arguments (at least, not in the way that VB/A does), you will have to respect the method signature and pass the arguments in the correct order.

    VB named arguments exist only to allow you pass the arguments in the wrong order, but the method still has a defined signature, and you can pass the arguments unnamed as long as they are in the correct order.

    Assuming that the signature is the same as the one defined here, I would imagine this should work:

    $com->SaveAs('mynewfilename.doc', 2, NULL, NULL, FALSE);
    

    Disclaimer: I am assuming that PHP COM will handle NULL and FALSE sensibly – this may be a foolish assumption.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the PHP SDK to make an FQL call to pull a list
It's clear from reading through threads that I can call a PHP function using
Currently, I'm using setInterval to run several AJAX functions that call PHP pages like
I make a call to a php file using jquery's ajax function. It goes
I am calling a php function using ajax call but its not working. I
I'm using the facebook graph PHP sdk - whenever I call the $facebook->api method
I am making a GET request to a REST API using PHP to call
I am using my php to call a js function like this: <?php $chk=1;
I'm using PHP's shell_exec function to call a bash script on my server. shell_exec(bash
I am using PHP's similar_text() call to compare two strings, however, I am not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.