Insert VBA macros in Word document using .NET

Hi,

I Created macro script to manipulate the text boxes inside word document .

I am creating the Word Document dynamically using Aspose.Words Document, i want to insert the macro script dynamically.

Let me know how we can do achieve this.

Thanks in advance,

Thanks,
Balakrishna

Hi Balakrishna,


Thanks for your inquiry.

I am afraid, there is no way to create or modify macros using Aspose.Words; however, macros are preserved upon open and save with Aspose.Words. Also, there is no way to run macros at the moment using Aspose.Words. We will consider providing limited support of macros such as reading a macros from document sometime in the future. Sorry for the inconvenience.

Best regards,
bkbalabk:
Hi,

I am exporting from HTML to Word ,where in html i have text boxes inside the grid ,when i insert data in textbox if data is more it is moving left side.

The same way when i insert data in word inside the table if the data is more columns are moving,

if i give allowautofit=false;
Columns are not moving ,but this time if data is more cell height is increasing,which looking worst.

is there is any way to move the data is moving left side like in html textbox.

Let me know how we can do achieve this.

Thanks in advance,

Thanks,
Balakrishna

Hi.


When i export from Html to word .Half of the textbox in word coming with same black color,

when i place a cursor in textbox,it is placing after the black color.

How we can remove this.

Note: If I use Formfields. Clear()… it is removing the data as well.

Let me know how we can do achieve this.

Thanks in advance,

Thanks,
Balakrishna

Hi Balakrishna,


Thanks for your inquiry. To ensure a timely and accurate response please supply us with the following information, if you cannot supply us with this information we will not be able to investigate your issue and raise a ticket.

  • What version of Aspose.Words for .NET are you using?
  • Please supply us with the code from your application that is causing the issue
  • Please supply us with the input HTML file that is causing the issue
  • Please supply us with the output Word document showing the undesired behavior
  • Please supply us with the target Word document showing the desired behavior. You can create target document using Microsoft Word. We just need to learn as to how you want your final document be generated like.

As soon as you get these pieces of information to us we’ll start our investigation into your issue.

Many thanks,

Does Aspose words have an ability to read the macros from a docm file?

Thanks

Hi Akram,


Thanks for your inquiry. Unfortunately, Aspose.Words does not support reading macros from document yet. Your request has been linked to the appropriate issue (WORDSNET-3714) in our issue tracking system and you will be notified as soon as it is supported. Sorry for the inconvenience.

Best regards,

A post was split to a new topic: Read macros from documents

The issues you have found earlier (filed as WORDSNET-3714) have been fixed in this Aspose.Words for .NET 19.6 update and this Aspose.Words for Java 19.6 update.

@anasrallah

With the latest version of Aspose.Words for .NET 20.5, you can insert macros into Word document. Please read the following article for more detail.
Working with VBA Macros