Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

VBA ReplacePages Method Fails

New Here ,
Mar 27, 2023 Mar 27, 2023

I have a macro that opens 2 pdf's and replaces pages from one with the pages from the other.But impossible to obtain a good result. The first PDF don't have the replaced page after save.

 

If Doc1.ReplacePages(Doc1.GetNumPages - 1, Doc2, 0, Doc2.GetNumPages, 1) = False  Then
   MsgBox "Cannot replace pages"
   Exit Sub
End If

I don't understand why the ReplacePage commande no longer works...

TOPICS
Acrobat SDK and JavaScript , Windows
780
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 27, 2023 Mar 27, 2023

1. You say it no longer works. When did ir work, and what changed?

2. Do you see the files open and close, or was it invisible anyway?

3. Does the update date change in the "saved" file?

4. Do you check the files open correctly? 
5. Please show the open and save code. 

Translate
LEGEND ,
Mar 27, 2023 Mar 27, 2023

1. You say it no longer works. When did ir work, and what changed?

2. Do you see the files open and close, or was it invisible anyway?

3. Does the update date change in the "saved" file?

4. Do you check the files open correctly? 
5. Please show the open and save code. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 27, 2023 Mar 27, 2023

Hi Test Screen, 4 was the wrong way. I forgot to put ".pdf" extendsion on Doc2... So now it works perfectly.

Regards.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 05, 2024 Aug 05, 2024
LATEST

Can you share your code?  Mine worked perfectly and in the past 6 months it stopped.  I am wondering if it's a security issue with the replace pages command not being set correctly.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines